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
How can we find the actual size of an object on the heap?
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }
How do I run java on windows?
Difference between overriding and overloading in java?
What is the difference between the size and capacity of a vector?
What is use of set in java?
Why do we need hashset in java?
how to handle exceptions in ejb?
Which is better singleton or static class?
Explain throw keyword in java?
What is nan inf?
Discuss about garbage collector in Java.
How does split work in java?
What is difference between path and classpath variables?
Is a char always 1 byte?