Use fenced code blocks by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language.
HelloWorld.java
Copy
class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); }}