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
why would you use a synchronized block vs. Synchronized method? : Java thread
Can we override private method in java?
How are variables stored?
What does i ++ mean in Java?
Explain a few methods of overloading best practices in java?
How the metacharacters are different from the ordinary characters?
Can a static member function access member variable of an object?
Why main function is static?
What is the byte range?
Can we have multiple catch block for a try block?
Is list ordered in java?
What is string variable?
What is hashmap and map?
What is the difference between import java.util.date and java .util?
Can we initialize the final blank variable?