In Java why we write public static void main(String args[])
why not main()?
Answer Posted / srinu
public static void main(String args[]) the meaning is
public:- Actually the main()method will be called by JVM .so
JVM is located other place so JVM will called by our main()
its public
static: with our object creation run our main()method so
thats its static
void:our main() method can't any return type thats its void
String args[]:. To get command_line arguments
| Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
Which methods cannot be overridden in java?
What are the five major types of reference sources?
What is the maximum length of a url?
Highest level event class of the event-delegation model?
What are examples of modifiers?
what is optional in java 8?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
How are java objects passed to a method and what are native methods?
Difference between static synchronization vs. Instance synchronization?
how can i use a nonsynchronized hashtable?
How do you do exponents in java?
What is object-oriented programming?
How to calculate the length of a singly linked list in java?
What is prefix of a string?
What is the use of callablestatement?