Skip to content

Latest commit

 

History

History
66 lines (50 loc) · 1.37 KB

File metadata and controls

66 lines (50 loc) · 1.37 KB

Formatting

You may have noticed that after each { all the code that comes after it is "indented" in one "level."

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Then, when there is a } everything is "de-dented" one level.

I will kindly ask that you try to stick to this rule when writing your own code as well. If you try to find help online and you haven't, it will be dyslexically hard for people to read your code.

So don't do this.

public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}}

Don't do this.

public class Main 
    {
    public static void main(String[] args) 
            {
        System.out.println("Hello, World!");
            }
    }

Don't do this.

public class Main {
    public static void main(String[] args) 
            {    System.out.println("Hello, World!");
    }}

And this is just insane.

public class Main { public static void main(String[] args) { System.out.println("Hello, World!"); } }

Do this.

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

And keep in mind that this rule of thumb applies to every language constrict that requires a { and } many of which I will introduce later.