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
What is instance means in java?
give an example for encapsulation?
What are the parts of a method?
How do you sort in ascending order in java?
How do you declare an array in java?
What is the size of arraylist in java?
what invokes a threads run() method? : Java thread
Can we restart a thread already started in java?
How can a gui component handle its own events?
What are the rules for naming an array?
When do we need to use internal iteration? When do we need to use external iteration?
Can we store variables in local blocks?
How many bits are in a sentence?
Can we define private and protected modifiers for the members in interfaces?
What is difference between hashset and hashmap in java?