Why declare Main() inside the class in java ?



Why declare Main() inside the class in java ?..

Answer / Vijay Singh Bhandari

The Main method is the entry point of any Java application. It is declared within a class because it needs to be associated with a specific class (the main class), which determines the name of the Java file and sets up the classpath for the program.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is hash code collision?

1 Answers  


what is web.xml?and its use?

7 Answers   CTS,


What is methods and methodology?

1 Answers  


What are the different types of inner classes?

1 Answers  


Can we have this () and super () together?

1 Answers  


What is the difference between Array and Hash Table?

1 Answers   Impetus,


What is array list in java?

1 Answers  


What error occurs if a try-catch-finally statement sequence does not have a catch clause?

4 Answers  


What is the use of optional ?

1 Answers  


How many types of array are there?

1 Answers  


Why is boolean important?

1 Answers  


diff. b/w JAVA and javascript...

3 Answers   NIIT,


Categories