Programming q
Programming q
super();
this.id = id;
this.name = name;
this.sal = sal;
public Employee() {
return id;
}
this.id = id;
return name;
this.name = name;
return sal;
this.sal = sal;
1.Create Employee class with fields id,name and sal and create Employee object and store data and display that data.
//here create object of Employee class and add 101,sam,1000 data into that
//here create object of Employee class and add 101,sam,1000 data into that using setter method
//here create object of Employee class and add 101,sam,1000 data into that using constructor
//here create object of Employee class and add 101,sam,1000 data into that
//call show method and pass this created object to show method
//do required changes to show method and display that data here
}
}
//here create object of Employee class and add 101,sam,1000 data into that
//call show method and pass this created object to show method
//do required changes to show method and display that data here
//here create two objects of Employee class and add data into that
//call show method and pass this two objects to show method
//do required changes to show method and display that data here
ex.setId(102);
9.
}
10.