WHAT IF THE STATIC MODIFIER IS REMOVED FROM THE SIGNATURE OF THE MAIN METHOD?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
Java 
 584  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    What if the static modifier is removed from the signature of the main method?

    Program compiles. But at runtime throws an error "NoSuchMethodError". This is the case before Java 1. 6 version but for Java 7 and onwards it will throw a Launch error : Selection does not contain a main type

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!