Why only one Class is public in one file? Explain in
details. Thanks in Advance.
Answer Posted / gopi
The class main method is start with public . This is
starting of the program, compiler have to know where to
start the program to compile. so only one public is there to
avoid confusion. We also use the public method to interact
with the out side of the programs. Without using of the
public class it can't possible to interact.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the difference between variable declaration and variable initialization?
What are methods of a class?
What is the difference between comparison done by equals method and == operator?
Where can I find jdk in my computer?
What is empty string literal in java?
What are accessor methods in java?
Is ++ operator is thread safe in java?
What does compareto () do in java?
Is empty list java?
What is a parameter example?
How big is a pointer?
Can constructor be inherited?
what is the difference between yielding and sleeping? : Java thread
What are scalar data types?
What is java object name?