Originally posted by Sanjay Mishra: I could not found method "main" in the java api's. Which class does it belong to?
main is a method that can be defined in any class with any signiture. HOWEVER in order for a class to be run using the java interperator, it must define a method with the signature static void main(String args) It will work with any access modifier but, you should give it a public modifier for clarity. The API's (Application Programmers Interface) provide a rich set of classes with methods that allow rapid development and consistantsy through reuse (the idea behind good OOP). None of the API's are intended to be a stand alone program and as such none define a main method.