can two class in a code be public??if yes then how??
Answer Posted / sreejesh1987
One java source file must have only one top-level(top level means not an inner class) public class with the same name as the name of the source file .
You can have inner classes to a class which are public. Hence in this way it is possible to have more than one public class in a single file.
Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
Explain differences between checked and unchecked exceptions in java?
What is passing value java?
Can a class be private?
How do you end a program?
Is 9 a prime number?
Explain java coding standards for methods?
Why java is made?
What is static synchronization?
Can we overload run() method in java?
What do you mean by exception handling in Java?
What are java packages?
How do you reverse a list?
What do you mean by object?
how are methods defined?
Is java map thread safe?