can anyone tell me to which to class main() belongs,as we know for each method there is a particular class.so main() as a method it should be under a class that would be predefined.
Originally posted by Mahesh Barik: ...so main() as a method it should be under a class that would be predefined...
A "main" method is not predefined for any particular class. It can be included in any class you decide to put it in. What is predefined is the way main (with the proper signature) is used as an entry point...
"A Java virtual machine starts execution by invoking the method main of some specified class..." (JLS - 12.1 Virtual Machine Start Up). [ October 10, 2006: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org