public class Employee {
private String Name;
private String SIN;
private Integer Salary;
public Employee(String string, String string2, int i) {
// TODO Auto-generated constructor stub
}
public Employee()
{
}
public Employee(String N, String sin, Integer Sal)
{
Name = N;
SIN = sin;
Salary = Sal;
}
public String getname()
{
return Name;
}
public String getsin()
{
return SIN;
}
public Integer getsalary()
{
return Salary;
}
public void setname(String N)
{
Name = N;
}
public void setsin(String sin)
{
SIN = sin;
}
public void setsalary(Integer sal)
{
Salary = sal;
}
public void display ()
{
System.out.println("Name: " + getname() + "\nSIN: " + getsin() + "\nSalary: "+ getsalary());
}
}
import javax.swing.JOptionPane;
public class EmployeeTest {
/**
* @param args
*/
public static void main(String[] args) {
Employee a = new Employee("Ferz", "564328946", 8000);
Employee e = new Employee();
e.display();
JOptionPane.showMessageDialog(null, "Name: " + a.getname() + "\nSIN: " + a.getsin()+
"\nSalary: " + a.getsalary(), "Employee Info", JOptionPane.PLAIN_MESSAGE ) ;
}
}
the above is my code.....
when am running the program am getting the null in both employee object... help me