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
State some advantages of java?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?
How many bytes is string in java?
How many return statement are allowed in a function?
What is difference between static and abstract class?
What is static variable with example?
Can we override the overloaded method?
List the interfaces which extends collection interface?
What is consumer interface?
What is final variable?
What does string intern() method do?
Why is the main method declared static?
What is a war file?
Where are register variables stored?
Where local and global variables are stored?