Help Finding Compiler error solution please

When I type in Javac at C prompt to this code I receive the following errors

Code:

public class PayrollExecute

{

// main method

public static void main( String args[] )

{

// Display welcome message

Payroll myPayroll = new Payroll( "Payroll " );

mypayroll.displayMessage(); // display first message

myPayroll.determineWeeklyRate(); // find weekly rate

} // end main method

} // end class

Error:

C:\>Javac Payroll.java

Payroll.java:1: class PayrollExecute is public, should be declared in a file named PayrollExecute.java

public class PayrollExecute

^

.\Payroll.java:1: class PayrollExecute is public, should be declared in a file named PayrollExecute.java

public class PayrollExecute

^

Payroll.java:13: cannot access Payroll

bad class file: .\Payroll.java

file does not contain class Payroll

Please remove or make sure it appears in the correct subdirectory of the classp

th.

Payroll myPayroll = new Payroll( "Payroll " );

^

3 errors

C:\>

[1119 byte] By [Jamesr2Ba] at [2007-11-27 11:38:42]
# 1

The file name of the java program has to the name of the public class in the java file.

Message was edited by:

New_Kid

New_Kida at 2007-7-29 17:21:44 > top of Java-index,Java Essentials,New To Java...
# 2

The name of the file you are compiling needs to be PayrollExecute.java OR remove the "public" before public class PayrollExecute.

Either choice should do the trick.

smithdale87a at 2007-7-29 17:21:44 > top of Java-index,Java Essentials,New To Java...