Can we have multiple public classes in a java source file?



Can we have multiple public classes in a java source file?..

Answer / Mr.prateek Sachdeva

Yes, it is possible to have multiple public classes in a single Java source file. Each public class should be written in its own separate class declaration.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

can write code for serialization ?

1 Answers   HCL, MegaSoft,


What are the advantages of assembly language?

1 Answers  


If your team member writes code with lots of static variables and static methods, will it cause any side effects?

3 Answers   KPIT,


How many bytes is a string in java?

1 Answers  


What is an association?

1 Answers  


What are the 5 types of research methods?

1 Answers  


I have one Shopping cart application, i that i have selected some items, while clicking submit button by mistake i have clicked twice or trice, that time items are selected twice or trice. Actually i want only one copy of items but its selected twice or trice. So how can we avoid this problem?

2 Answers   Honeywell,


What is the difference between ArrayList and Vector? which one is better in Java

1 Answers   SkillGun Technologies,


What are the advantages of inner classes?

1 Answers  


How do you download stubs from Remote place?

1 Answers  


String is a immutable objects . it means that string does not change........... But it will be chang......... { String s="kapil"; String s1="raj"; String s=s1; then print(.......) The String has been changed .. how it is possible and why its called immutable objects

7 Answers  


how to handled exceptions & erros in ejb?

1 Answers   Satyam,


Categories