In Java why we write public static void main(String args[])
why not main()?
Answer Posted / kanchan bangar
In java if we are not writting public static void main
(String args[]) then program is only compield not run
that's why it must write because compiler in java always
look the main function and when compiler always calls the
main class is loaded in frist time call for that static
keyword is used and public is for access everything means
methods and member variabls of any pakage and classes or in
super class and meand it does not return any value.
| Is This Answer Correct ? | 18 Yes | 57 No |
Post New Answer View All Answers
how are methods defined?
Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.
Can I extend singleton class in java?
How do you write methodology?
Explain the difference between string, stringbuffer and stringbuilder in java?
Where are global variables stored?
What are voids?
What is the size of integer?
What is the base class of all classes?
What is java life cycle?
Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?
Is boolean a wrapper class in java?
Explain Basics of OOP Language in java
What will be the initial value of an object reference which is defined as an instance variable?
What is internal variable?