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
What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?
What is the nested interface?
What is meant by anonymous class?
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
What is the difference between double and float variables in java?
Is alive method in java?
What does math floor () do?
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
Explain about main() method in java ?
What is finalize()? Is finalize() similar to a destructor?
Difference between notify() method and notifyall() method in java?
What is the do while loop syntax?
What is the size of arraylist in java?
Can a class have 2 constructors?
What is google full form?