obasan Posted April 7, 2017 Posted April 7, 2017 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() }
GaetanoH Posted April 7, 2017 Posted April 7, 2017 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. 2
Explv Posted April 7, 2017 Posted April 7, 2017 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. 1
Alek Posted April 8, 2017 Posted April 8, 2017 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. 1