Question: What happens on the object jamie and the object jane after executing the following jamie.give Last NameTo2(jane)? public class Name { private String first;
What happens on the object jamie and the object jane after executing the following jamie.give Last NameTo2(jane)? public class Name { private String first; private char initial; private String last; Name jamie = new Name(); jamie.setFirst("Jamie"); jamie.setLast ("Jones"); Name jane = new Name(); jane.setFirst("Jane"); jane.setLast("Doe"); jamie.giveLastName To2 (jane); public void give Last Name To2 (Name child) { String firstName = child.getFirst(); child = new Name(); child.setFirst(firstName); child.setLast (last); } //end giveLastNameTo2
Step by Step Solution
There are 3 Steps involved in it
The code provided has some syntax errors and inconsistencies so Ill correct them and explain what ha... View full answer
Get step-by-step solutions from verified subject matter experts
