Explain Public static void main?
Answers were Sorted based on User's Feedback
Answer / ranganathkini
public static void main( String[] args )
1. public - declares that the main method is publicly
accessible to other classes
2. static - declares that the main method can be invoked
without creating an instance of the class
3. void - declares that the main method does not return any
value.
4. main - defines the name of the method
5. String[] args - defines a parameter to the main method
which will contain any command line options passed by the
user when invoking the progam.
These command line options will be passed to the program as
an array of string objects.
| Is This Answer Correct ? | 182 Yes | 6 No |
Answer / ravikiran(aptech mumbai)
public-this method is accessible in all the classes
static-this method is called before creation of any instance
void-this method doesn't return any thing
main-Is the name of the method
| Is This Answer Correct ? | 58 Yes | 19 No |
What is bufferedreader in java?
What is the generic class?
State differences between C and Java?
0 Answers Deloitte, JPMorgan Chase,
Is hashmap thread safe?
Can you achieve runtime polymorphism by data members?
Write a function to find out longest palindrome in a given string?
What is the reason that multiple inheritance is not possible in java??
What about interthread communication and how it takes place in java?
What is void data type?
What is the full meaning of java?
What are triggers in DB? Explain their types. How do they work?
Can we sort arraylist in java?