can two class in a code be public??if yes then how??
Answer Posted / siva
NO only one class should be public if we write multiple
classes in a same file.we can write multiple class files in
a single file.if main() is there in one of the classes then
it should be declare as public.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Do I need to import java.lang package any time? Why?
What is a void method java?
What is the use of hashmap in java?
What does this () mean in constructor chaining concept?
What is the difference between char and char *?
Difference between default and protected access specifiers?
What is hashing principle in java?
What is mvc in java?
Which command from the jdk compiles a java program?
What will be the initial value of an object reference which is defined as an instance variable?
What is a void method?
What are the string methods in java?
How many bytes is a string in java?
What is polymorphism java example?
What must a class do to implement an interface in java programming?