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 many threads can java run?
What is size of int in java?
What are the 6 functions?
What is canonical name in java?
What is the use of coding?
Why string is a class?
What is the purpose of checked and unchecked exceptions in JAVA?
What is the difference between the paint() and repaint() methods?
What is the r character?
What is array and arraylist in java?
Can static method access instance variables ?
Can an interface be final?
Give me example of derived data types.
Mention some interfaces implemented by linked list in java.
What is lazy initialization in java?