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
why are wait(), notify() and notifyall() methods defined in the object class? : Java thread
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?
What is split return?
What is the difference between super class & sub class?
What are the parts of a method?
What is blank final variable?
what is abstract class in Java?
How can you set an applet’s height and width as a percentage?
What is a map? What are the implementations of map?
What is an image buffer?
What are triggers in DB? Explain their types. How do they work?
What is the synchronized method modifier?
How destructors are defined in java?
when you will synchronize a piece of your code? : Java thread
Why are the objects immutable in java?