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
How to declare objects of a class ?
What is the difference between JDK and JVM?
What about method local inner classes or local inner classes in java?
What is an array in java?
What is factor r?
What does indexof return in java?
Is array dynamic in java?
What is the main functionality of the remote reference layer?
What is fundamental datatype?
What is a pattern what is an anti pattern?
What does super keyword do?
Are true and false keywords?
What is the char data type?
What is the default value of byte datatype in java?
What are packages in java?