cannot find symbol...inheritance

I'm totally new to Java, and so I am probably making a stupid mistake.

I get the error:

JPEST.java:39: cannot find symbol

symbol : constructor JPSTUDENT()

location: class JPSTUDENT

JPSTUDENT student1 = new JPSTUDENT();

^

JPTEST.java:40: cannot find symbol

symbol : constructor JPEMPLOYEE()

location: class JPEMPLOYEE

JPEMPLOYEE employee1 = new JPEMPLOYEE();

^

2 errors

This is my code:

publicclass JPTEST

{

publicstaticvoid main( String args[] )

{

JPPERSON person1 =new JPPERSON();

JPSTUDENT student1 =new JPSTUDENT();

JPEMPLOYEE employee1 =new JPEMPLOYEE();

}

}

And the other three classes:

publicclass JPPERSON

{

publicstatic String first;

publicstatic String last;

publicstaticint id;

publicvoid JPPERSON( )

{

first ="No first name";

last ="No last name";

id= 000000000000;

}

}

publicclass JPSTUDENTextends JPPERSON

{

privatestaticint hours;

privatestatic String course[][] =new String[10][4];

privatestatic String grades[];

privatestatic String grade;

privatestatic String coursename;

publicvoid JPSTUDENT( )

{

hours = 0;

grade ="x";

}

}

publicclass JPEMPLOYEEextends JPPERSON

{

privatestaticint hoursworked;

privatestaticdouble salary;

publicvoid JPEMPLOYEE( )

{

hoursworked = 0;

salary= 0.00;

}

}

[3687 byte] By [jami52a] at [2007-10-3 6:15:27]
# 1

The code you posted compiles with no errors for me. Perhaps you made changes and didn't save them.

However, you are going to find problems later. There's big difference between a Constructor and a Method.

CONSTRUCTORpublic JPPERSON( )

METHODpublic void JPPERSON( )

Also, it will be easier for people to help you if follow Java naming conventions. A Class Name should start with a capital letter but should not be all caps. JPPerson for example.

atmguya at 2007-7-15 0:59:45 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

> I get the error:

> JPEST.java:39: cannot find symbol

> symbol : constructor JPSTUDENT()

> location: class JPSTUDENT

> JPSTUDENT student1 = new JPSTUDENT();

> ^

> symbol : constructor JPEMPLOYEE()

> location: class JPEMPLOYEE

> JPEMPLOYEE employee1 = new JPEMPLOYEE();

>^

> de]public class JPTEST

> {

I don't believer either of your errors. The error message indicates that you had an error on line 39. That's pretty hard to believe when your JPTEST source code file only has 15 lines in it. I bet the code you posted works just fine.

Second, the error indicates you're not providing a no argument constructer. The compiler will do this for you if you don't explicitly provide one yourself. I'm guessing you have some explicit constructor that takes some number of arguments meaning there is no "no argument" constructor available.

Your solution might be simple. Perhaps you did not mean to include the following method:

public void JPSTUDENT( )

{

hours = 0;

grade = "x";

}

Did you intend that code to be a constructor? If so, do not include a return type when you declare it.

public JPSTUDENT( )

{

hours = 0;

grade = "x";

}

BillKriegera at 2007-7-15 0:59:45 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3
Have you saved the classes in different files or in the same file?
hnhegdea at 2007-7-15 0:59:45 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...