Why do we use public static with the main function in Java?
Answer Posted / ravikiran(aptech mumbai)
public means we are allowing the main method to be accessed
any where in the application.and is declared static because
jvm will look for the static one's once it completes the
loading the class.
| Is This Answer Correct ? | 11 Yes | 5 No |
Post New Answer View All Answers
Explain about member inner classes?
Does a function need a return?
How many types of the indexof method are there for strings?
What is oop principle in java?
What is comparable and comparator interface? List their differences
What is api in java?
What happens when main () method is declared as private?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
how to create daemon thread in java?
What is set and get methods in java?
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 programs use java?
What is the difference between super class & sub class?
Can you declare the main method as final?
What is the difference between variable declaration and variable initialization?