In Java why we write public static void main(String args[])
why not main()?
Answer Posted / kedar
static methods can be accessed without creating object object of class, we know that file name of java program is "classname.java", "classname" is the class which contain main function, so it is easier for compiler to locate class which contain main(), and because of static nature it can execute it.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is java beans?
What must a class do to implement an interface in java programming?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
Difference between nested and inner classes ?
what is meant by Byte code concept in Java?
Give few difference between constructor and method?
What is treeset in java?
What is a container in a gui?
Is null a string or object in java?
What is Garbage Collection in Java
Can we declare a static variable inside a method?
Is java free for businesses?
How many types of memory areas are allocated by JVM in java?
How are variables stored?
What is boolean false?