April 7, 20178 yr Does it matter if its like this: public static void main(String[] args) { sayHello() } static void sayHello() { System.out.println("Wuz gud"); } OR this: static void sayHello() { System.out.println("Wuz gud"); } public static void main(String[] args) { sayHello() }
April 7, 20178 yr No they both work, but it's generally best practise to write the methods under the public static void main(String[] args) { sayHello(); } to get a better overview of the application.
April 7, 20178 yr Best practice is to place a method below the method that is calling it. So that you can follow the code more easily from top to bottom.
April 8, 20178 yr This shows you all the coding conventions for Java (from an official source):http://www.oracle.com/technetwork/java/codeconvtoc-136057.html It tells you about spacing, brackets, naming styles, etc.
Create an account or sign in to comment