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


Please Help Members By Posting Answers For Below Questions

What is integer size in java?

514


What is the indent key?

594


What are the two parts of a conditional statement?

518


Is array size fixed in java?

546


What do you mean Abstraction in java?

611






Is java type safe?

515


What are the different tags provided in jstl?

553


A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.

546


why doesn't java run on all platforms?

573


What is boolean false?

531


Can we start a thread twice in java?

514


Is there any sort function in java?

579


Why does java not support pointers?

556


What are the types of exceptions?

598


What is the parse method in java?

576