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
Can we write class inside a class in java?
What is Java Reflection API? Why it’s so important to have?
What are the different types of inner classes?
Why char array is favored over string for the storage of passwords?
Is null an object java?
What does file separator do in java?
What lambda means?
What are the 5 types of research methods?
What is java and its types?
Java.util.regex consists of which classes?
What is var keyword ?
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
What is charat ()?
what do you mean by marker interface in java?
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }