Hi Kumar,
A source file can contain more than one top level class but only one top level class can be declared public. (A top level class is not enclosed within the declaration of another class).
For example,
<code>
public class TopOne {}
class TopTwo {}
class TopThree {}
</code>
The above declarations can all appear in one source file. The file must be saved as <code>TopOne.java</code> (it has to match the name of the public top level class).
However, the following source file would produce a compile error:
<code>
public class TopOne {}
public class TopTwo {}
class TopThree {}
</code>
as it declares more than one public top level class.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
Co-author
Mike Meyers' Java 2 Certification Passport