| Author |
compile time errors
|
Venkat Ramsimha
Ranch Hand
Joined: Dec 28, 2004
Posts: 127
|
|
public class MyOuter { public static void main(String args[]) { System.out.println("hi"); } public class MyInner { } } Hi All, the above program is compiling fine even if we have more than one public class file?how come its possible?should compiler must not show compile time errors? anybody please provide the solution Thanks venkat
|
 |
Jas Oberai
Ranch Hand
Joined: Jan 16, 2005
Posts: 231
|
|
|
The name of the class itself suggests one is outer and other is inner class.You can't have two top-level classes with public as the access modifier,but there's no problem as shown with your code...and so it compiles fine
|
SCJP 1.4 (88%)<br />SCWCD 1.4 (88%)
|
 |
 |
|
|
subject: compile time errors
|
|
|