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
Is java 11 paid version?
What is the meaning of find and replace?
What is the static field modifier?
Can we convert stringbuilder to string in java?
explain local datetime api in java8?
What is a heavyweight component?
What are the three parts of a lambda expression? What is the type of lambda expression?
Can a constructor be private and how are this() and super() method used with constructor?
Explain about anonymous inner classes ?
List the different types of classloaders in java.
Why we cannot override static method?
How do you use equal in java?
Is string is a class in java?
What is integer parseint?
Why are there no global variables in java?