What happens when a main method is declared as private?
Answer Posted / amit kumar chaubey
If the main function is made private...it will compile
Sucessfully...and at the time of execution...it will
execute successfully...but desired result will not be
obtained. After execution..folowin message will be printed:
Main method not public.
| Is This Answer Correct ? | 25 Yes | 3 No |
Post New Answer View All Answers
What does the “final” keyword mean in front of a variable? A method? A class?
What is java and why do we need it? Explain
what is the difference between a threads start() and run() methods? : Java thread
Explain wait() method of object class ?
What is an infinite loop? How infinite loop is declared?
Explain about member inner classes?
how would you implement a thread pool? : Java thread
What is the difference between abstraction and encapsulation?
What is meant by structural programming?
Can we change the value of static variable?
What are static methods?
What is the default value of local and global variables?
Can memory leak happen java?
Explain about the interpreter in java?
What is an class?