Results 1 to 2 of 2
- 03-30-2008, 05:27 AM #1
Member
- Join Date
- Mar 2008
- Posts
- 2
- Rep Power
- 0
[SOLVED] Problem with code - inheritence
Hi, Newbie here, and am getting the following error in eclipse:
'Supervisor cannot be resolved to a type' .
I don't get why I am getting this error. Thanks for your help.
public class EnterEmployee {
public static void main(String[] args) {
Supervisor s = new Supervisor("title","naperville");
}
}
--------
public class Supervisor extends Employee1 {
public String title;
public String office;
public Supervisor() {
}
public Supervisor(String title, String office) {
this.title = title;
this.office = office;
}
public String getTitle() {
return title;
}
public String getOffice() {
return office;
}
public void setTitle (String title) {
this.title = title;
}
public void setOffice (String office) {
this.office = office;
}
}
--------
public class Employee1 {
public String firstName;
public String lastName;
public String empID;
public String phoneNumber;
public Double salary;
public String empAddress;
// Constructor #1
public Employee1() {
}
// Constructor #2
public Employee1 (String fName, String lName, String ID,double sal,String address,String Phone) {
setFirstName(fName);
setLastName(lName);
setEmpID(ID);
setSalary(sal);
setAddress(address);
setPhone (Phone);
}
public void setFirstName (String fn) {
firstName = fn;
}
public void setLastName (String ln) {
lastName = ln;
}
public void setEmpID (String eid) {
empID = eid;
}
public void setPhone (String ph) {
phoneNumber = ph;
}
public void setSalary (double sal) {
salary = sal;
}
public void setAddress (String empAdd) {
empAddress = empAdd;
}
//Gets first name
public String getFirstName() {
return firstName;
}
//Gets Last name
public String getLastName() {
return lastName;
}
//Gets Employee1 id
public String getEmpID() {
return empID;
}
//Gets hire date
public String getPhoneNumber() {
return phoneNumber;
}
//Gets salary
public Double getSalary() {
return salary;
}
//Gets title
public String getAddress () {
return empAddress;
}
} // close the class
- 03-30-2008, 06:11 AM #2
Member
- Join Date
- Mar 2008
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
[SOLVED] Problem with setVisible(); on LINUX
By lepetitprince in forum AWT / SwingReplies: 9Last Post: 11-22-2008, 04:14 PM -
[SOLVED] alignment problem
By nanimtech in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 04-10-2008, 01:23 PM -
[SOLVED] Problem with extending classes...
By Bizmark in forum New To JavaReplies: 4Last Post: 04-07-2008, 11:21 PM -
[SOLVED] file i/o problem
By aytidaalkuhs in forum New To JavaReplies: 3Last Post: 04-06-2008, 06:42 PM -
[SOLVED] Actionevent problem
By Cymro in forum New To JavaReplies: 3Last Post: 04-04-2008, 07:11 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks