Skip to content

Commit 2a790dc

Browse files
committed
6.2 Method to return object
This programm will include method copyEmployee() which will accept object of class employee in the parameter list and return the object to the calling method
1 parent 6c2f8d6 commit 2a790dc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

TestEmployeeObject.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ void getData()
2626
}
2727
Employee copyEmployee(Employee e)
2828
{
29-
Employee de = new Employee();
30-
de.name =e.name;
31-
de.e_id = e.e_id;
32-
de.salary = e.salary;
33-
de.status = e.status;
29+
Employee de = e;
3430
return de;
3531
}
3632
}

0 commit comments

Comments
 (0)