Every method has to be part of a Class. The difference between a main method (actually the main method which you are talking about) and any other method is that execution of the program starts at the main method . A method represents a functionality or a set of instructions that have been grouped together.
Read moreIs class and method same?
Yes, It is allowed to define a method with the same name as that of a class . There is no compile-time or runtime error will occur.
Read more