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
Can we have more than one package statement in the source file?
Explain treeset?
What is the different between get and post?
Why do we need variables?
Can we pass null as argument in java?
What is generic type?
What is Recursion Function?
Explain about the security aspect of java?
What are different type of exceptions in java?
How can you set the applet size?
Can we assign the reference to this variable?
Is an object null?
Is a string literal?
Why is java so important?
what is a working thread? : Java thread