Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-30-2008, 06:27 AM
Member
 
Join Date: Mar 2008
Posts: 2
yalla is on a distinguished road
[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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-30-2008, 07:11 AM
Member
 
Join Date: Mar 2008
Posts: 2
yalla is on a distinguished road
this is not a problem. user error
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] alignment problem nanimtech JavaServer Pages (JSP) and JSTL 1 04-10-2008 02:23 PM
[SOLVED] Problem with extending classes... Bizmark New To Java 4 04-08-2008 12:21 AM
[SOLVED] Problem with setVisible(); on LINUX lepetitprince AWT / Swing 6 04-07-2008 03:14 PM
[SOLVED] file i/o problem aytidaalkuhs New To Java 3 04-06-2008 07:42 PM
[SOLVED] Actionevent problem Cymro New To Java 3 04-04-2008 08:11 AM


All times are GMT +3. The time now is 12:47 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org