| Author |
More than one!!
|
Niyas Ahmed Sheikh
Ranch Hand
Joined: Jun 15, 2005
Posts: 129
|
|
Error Message: AA111.java:1: class C is public, should be declared in a file named C.java public interface C ^ AA111.java:6: class B is public, should be declared in a file named B.java public interface B ^ 2 errors Why if I am using more than one 'public' class or interface raises an error?
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
|
As the error messages imply, a public class X must be in a file named X.java. That's just the rule. You can include any number of nonpublic classes in a single file, however.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: More than one!!
|
|
|