who can help me in java?
this is my code:
//employee.java
public class Employee
{
String emp_id;
String emp_name;
String emp_icno;
char emp_gender;
String emp_dob;
String emp_addr;
String emp_comDate;
String emp_dept;
String emp_pos;
double emp_sal;
public Employee()
{
emp_id = "99999";
emp_name = "";
emp_icno="";
emp_gender='m';
emp_dob="";
emp_addr="";
emp_comDate="";
emp_dept="";
emp_pos="";
emp_sal=0;
}
public void setEmp_id(String aId)
{
emp_id=aId;
}
public String getEmp_id()
{
return emp_id;
}
public void setEmp_name(String aName)
{
emp_name=aName;
}
public String getEmp_name()
{
return emp_name;
}
public void setEmp_icno(String aIcno)
{
emp_icno=aIcno;
}
public String getEmp_icno()
{
return emp_icno;
}
public void setEmp_gender(char aGender)
{
emp_gender=aGender;
}
public char getEmp_gender()
{
return emp_gender;
}
public void setEmp_dob(String aDob)
{
emp_dob=aDob;
}
public String getEmp_dob()
{
return emp_dob;
}
public void setEmp_addr(String aAddr)
{
emp_addr=aAddr;
}
public String getEmp_addr()
{
return emp_addr;
}
public void setEmp_comDate(String aComDate)
{
emp_comDate=aComDate;
}
public String getEmp_comDate()
{
return emp_comDate;
}
public void setEmp_dept(String aDept)
{
emp_dept=aDept;
}
public String getEmp_dept()
{
return emp_dept;
}
public void setEmp_pos(String aPos)
{
emp_pos=aPos;
}
public String getEmp_pos()
{
return emp_pos;
}
public void setEmp_sal(double aSal)
{
emp_sal=aSal;
}
public double getEmp_sal()
{
return emp_sal;
}
}
-------------------------------------------------------------------
EmployeeDb.java
import java.io.*;
public class EmployeeDb extends Employee
{
public static void main(String Args[]) throws IOException
{
Employee[]empRec=new Employee[3];
System.out.println("Enter a name");
//for(int i=0;i<empRec.length;i++)
//{
//empRec=new Employee();
//System.out.println("enter a name");
//empRec.setEmp_name.System.in.read();
//}
for(int i=0;i<empRec.length;i++)
{
System.out.println(empRec.getEmp_id());
System.out.println(empRec.getEmp_name());
System.out.println(empRec.getEmp_icno());
System.out.println(empRec.getEmp_gender());
System.out.println(empRec.getEmp_dob());
System.out.println(empRec.getEmp_addr());
System.out.println(empRec.getEmp_comDate());
System.out.println(empRec.getEmp_dept());
System.out.println(empRec.getEmp_pos());
System.out.println(empRec.getEmp_sal());
}
}
}
i want to prompt user to enter three employee's information from the console and store data in an array...
id number is set to 99999...
i can key in but the mutator(set) cannot bring to the accesor(get)....
how to code it to enter the information...
thanks....