In Java why we write public static void main(String args[])
why not main()?
Answer Posted / pandurang d billavar
for execution of class in java is done by creating a object
for methods of that class.so main method is also a class
method.so this method is called by jvm directly without
creating object for main method.it is possible only if main
is static.............so we maked main as static.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can you access non static variable in static context?
What are abstract methods in java?
Can a final variable be manipulated in java?
Difference between character constant and string constant in java ?
Can we execute java program without main method?
Which variables are stored in heap?
What is the declaration statement?
Can you pass by reference in java?
Can we have two methods in a class with the same name?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
How does java pattern compile work?
What is difference between class and object in java?
Can private members of a base class are inheritable justify?
Is finalize() similar to a destructor?