5 years ago in Introduction To Java

The expected signature of the main method is public static void main(). What happens if we make a mistake and forget to put the static keyword ?

[A] The JVM issues an error saying that main method should be declared static
[B] The compiler issues a warning saying that main method should be declared static and adds it automati
[C] The JVM successfully invokes the main method
[D] The JVM fails at runtime with NoSuchMethodError
Loading...
Next Question

Overall Stats

Attempted 1206
Correct 180
Incorrect 493
Viewed 533

Answers

Guest
Guest
Vonani Ndlovu - 6 months ago

a P52621kmjhnb5

Rinky - 2 years ago

compiled successfully and after running error msg came main method is not static in class please add this as public static void main (String args[])

anuj - 4 years ago

compile successfuly and no such found the main method

Techy Gamer
Techy Gamer - 4 days ago

Techy Gamer is saying The compiler issues a warning saying that main method should be declared static and adds it automati is correct answer

Tsega Asresa Mengistu
Tsega Asresa Mengistu - 4 days ago

Tsega Asresa Mengistu from Dessie, Ethiopia is saying The JVM successfully invokes the main method is correct answer

Related Questions

What allows the programmer to destroy an object x?

  • [A] Only the garbage collection system can destroy an object.
  • [B] X.delete
  • [C] X.destroy
  • [D] none

Sharing of common information is achieved by the concept of ?

  • [A] polymorphism
  • [B] encapsulation
  • [C] inheritance
  • [D] none of above