public class Employee {
int age = 32;
String name = "Kevin";
public Employee updateEmployee(Employee e) {
e = new Employee();
e.age = 56;
e.name = "Jeff";
return e;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Employee t = new Employee();
t.updateEmployee(t);
System.out.println("age= " + t.age + " " + "name= " + " " + t.name);
}
}
===================
OUTPUT:-
age= 32 name= Kevin
Why is the output not 56 and Jeff. I updated the object reference "t" in the method? Please help.