In Java why we write public static void main(String args[])
why not main()?
Answer Posted / sivadasan
1. public - Access Specifier, properties and methods can
access anywhere, any package.
2. main() - The Java environment starts the execution of a
program from main() method.
3. void - The main() method is not return anything. So the
return type of the main() method must be void.
4. static - The jave environment able to call the main()
method without creating an instance of the class. So its
declared as static
5...(String args[]) -- In java, whatever we give, it will
takes as String. So we are giving the command line argumet
as String.
i hope it will help u..
Shivadasan
Coromandel Infotech
| Is This Answer Correct ? | 16 Yes | 4 No |
Post New Answer View All Answers
How infinite loop is declared?
Why java is considered as platform independent?
What does this () mean in constructor chaining concept?
Can java hashmap have duplicate keys?
How do you input a string in java?
How do you sing an Applet ?
How do you pass by reference?
How do I enable java in safari?
What are the 8 data types in java?
What are the two types of java programming?
What is a java string?
What is a hashmap used for?
How to create com object in Java?
How many types of flags are there?
Why java uses the concept of the string literal?