when everything can be done by static block then why do we
use main method?.
Answer Posted / guest
the main block is declared as static sothat the java
interpreter could use it without instantiating it,but if we
declare everything as static there is no meaning of a class
and specifying instance variables and methods belong to
that specific class only.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a variable simple definition?
Define a java class.
What is a method declaration?
What is ide with example?
why are there separate wait and sleep methods? : Java thread
How is the marker interface used in Java?
What is a method vs function?
What is an exception in java?
What is the final method?
Is math an abstract class in java?
What is volatile keyword in java
What is percentage in java?
Is finalize() similar to a destructor?
What is the java reflection api? Why it’s so important to have?
How do I get 64 bit java?