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
Say any two properties in beans?
How many ways can we create the string object?
how we can make a write-only class in java?
If a class is declared without any access modifiers, where can the class be accessed?
Why array is used in java?
How can you read an integer value from the keyword when the application is runtime in java? example?
What is "this" keyword in java? Explain
What are the different access modifiers available in java?
What is the purpose of main function in java?
When is finally block not called?
How do you calculate roots in java?
What is the use of 'super' keyword inside a constructor?
Is math class static in java?
Difference between overriding and overloading in java?
What is the purpose of garbage collection in java? When is it used?