Does the order of a Java class matter?
java, layout, structure
Solution
The order does not matter. But there is a common courtesy to public methods and static methods at the beginning of a class. This is just a developers choice
Problem
Is there any difference between the following? : Example 1: ``` public class OddEven { private static void OddEven() { //some calculation. } public static void main(String[] args) { OddEven(); } } ``` Example 2: ``` public class OddEven { private static void main(String[] args) { OddEven(); } private static void OddEven() { //some calculation. } } ``` The reason I ask is I would always go with example 2, putting Main first. Though most of the examples I've seen online put the methods first, before Main. I've never had formal computing lessons, and I apologise if this is an obvious question, but I'd like to know: - Is the order of the layout simply aesthetics, or convention? - Does it make any difference in processing efficiency and/or memory? - If so, is that saving seen for all programming languages? Thanks for any help on this topic.