I get an exception if I remove the static modifier from main?



I get an exception if I remove the static modifier from main?..

Answer / Amitesh Srivastava

Yes, removing the static modifier from the main method in Java will result in a compile-time error. The main method must be declared as static so that it can be called by the JVM.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Java Related AllOther Interview Questions

Is jdk an ide?

1 Answers  


Why oracle type 4 driver is named as oracle thin driver?

1 Answers  


What is meant by annotation in java?

1 Answers  


What is gui in java with examples?

1 Answers  


What is the locale class?

0 Answers  


What is data encapsulation?

1 Answers  


Can we use lambda without functional interface?

1 Answers  


What are jpa repositories?

1 Answers  


What do you mean by exception handling?

1 Answers  


What is jpa project?

1 Answers  


What are the types of cookies in java?

1 Answers  


What is phantom memory?

1 Answers  


Categories