Can we compile and execute a Java class without main method ?
Questions
Search
List By Company
List By Topic
Legacy
Tests
Repository
DashBoard
Java
Java 8
Java 7
Java Abbreviations
OCJP / SCJP
Class List
New in Java 8
Java Exceptions
Spring Exceptions
Java Enums
Java 8 Lambda
Java 8 java.time
Big Data
Best Of Java
Discussion
Search
Subscribe
Search Interview Questions
More than 3000 questions in repository.
There are more than 900 unanswered questions.
Click here
and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company
Label / Company / Text
Search
Submit Question
Interview Questions and Answers
Q1.
Can we compile and execute a Java class without main method ?
Core Java
Ans. No without main method can not be executed it will throw an error illegal start of type. Main method is the entry point of application.
Help us improve. Please let us know the company, where you were asked this question
:
Like
Discuss
Correct / Improve
 jvm  compilation  main method
Basic
Correction
Duplicate of Another Question
Company where this question was Asked
Suggestion
Related Questions
Why do we write public static void main ? Can we use some other syntax too for main ?
Which of the following is false about main method ?
a. It should be declared public and static
b. it should have only 1 argument of type String array
c. We can override main method
d. We can overload main method
Can we have multiple main methods in a single class ?
Can we overload main method in Java ?
What will happen if static modifier is removed from the signature of the main method?
How can we execute a Java class independently if it doesn't have a static main method ?
Can we declare a main method as abstract ?
Do all java classes need a main method?
Can we declare the main method as private ?
Why main method is declared static ?
Help us and Others Improve. Please let us know the questions asked in any of your previous interview.
Any input from you will be highly appreciated and It will unlock the application for 10 more requests.
Company Name:
Questions Asked: