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 a wrapper method?
What is the difference between numeric and integer?
What is variable and example?
What are default methods ?
What is a ?
What happens if we override private method?
Is a class subclass of itself?
How do you sort in descending order in java using collections sort?
Is constructor inherited?
What are 3 boolean operators?
What is the importance of hashcode() and equals() methods?
Which language is java?
What is java instanceof operator?
What is assembly language?
What are the classes of java?