info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT: Java filenames and classes


From: Noel Yap
Subject: Re: OT: Java filenames and classes
Date: Fri, 1 Mar 2002 05:17:43 -0800 (PST)

--- "Mark A. Flacy" <address@hidden> wrote:
> I sit partially corrected.
> 
> A public class must sit in a file that matches the
> classname.  A package
> level class does not.  The directory where the
> source resides does not have
> to match in any fashion the package statement
> included in the source file.
> 
> FWIW, in java 1.2.2 the error message contained
> "...must be defined in a
> file..." 

Using Java 1.3, I still get similar output:

nyap:address@hidden:~/proj/Asdf> cat Asdf.java
package Aoeu;

public class Aoeu
{
        public static void main(String[] args)
        {
                System.out.println("Yo");
        }
}
nyap:address@hidden:~/proj/Asdf> javac -classpath .
Asdf.java
Asdf.java:3: class Aoeu is public, should be declared
in a file named Aoeu.java
public class Aoeu
       ^
1 error
mv Asdf.nyap:address@hidden:~/proj/Asdf> mv
Asdf.java Asdf
nyap:address@hidden:~/proj/Asdf> javac -classpath .
Asdf/Asdf.java
Asdf/Asdf.java:3: class Aoeu is public, should be
declared in a file named Aoeu.java
public class Aoeu
       ^
1 error

Noel

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]