View Single Post
  #1 (permalink)  
Old 12-11-2007, 04:42 AM
Shaolin Shaolin is offline
Member
 
Join Date: Nov 2007
Posts: 37
Shaolin is on a distinguished road
Weird data output
Hi Guys,

I have a main class, an employee class and a fullTime class which is a subclass of employee. I am trying to output some hard written data in the main class but I get the following characters when I run it:

Quote:
FT@19821f
FT@addbf1
Here is my code:

Employee Class:
Quote:
public abstract class Employee {

protected int workid ;
protected String name ;
protected int tel ;
protected static int lastid = 100000 ;
protected double pay ;

public Employee() {
name = "" ;
tel = 0;
workid = lastid++ ;
pay = 0.0 ;
}

public Employee (String nm, int ext) {
name = nm ;
tel = ext ;
workid = lastid++ ;
pay = 0.0 ;
}

public abstract void calculatePayment(); // abstract method

}
FullTime Class:
Quote:
public class FT extends Employee {

protected static double salary = 1600.0;

public FT () {
super();
}

public FT (String nm, int ext){
super(nm, ext);
}
}
Main Class:
Quote:
public class main {

public static void main( String[] args )
{
FT e1 = new FT ( "John", 1237 ) ;
FT e2 = new FT ( "Michelle", 1291 ) ;

System.out.println( "test: " + e1 ) ; // Output data

}


}

Last edited by Shaolin : 12-11-2007 at 04:45 AM.
Reply With Quote
Sponsored Links