Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java question. will leave a like You have created the following class called Dog: How would you use aggregation in a DogWalker class to show
java question. will leave a like You have created the following class called Dog: How would you use aggregation in a DogWalker class to show that a dog walker has one or more dogs? How would you use aggregation in a DogWalker class to show that a dog walker has one or more dogs? public class Dogwalker extends Dog \{ private ArraylistcDog> dogList; 3 public class Dogvalker \{ private Dog dogList; \} public class Dogwalker extends Dog \{ 3 public class Dogaralker ? private ArrayList Dog dogList = new ArrayList (); 3 Given the following class, how would an instance of the class need to be declared with the userName changed to Sophia after the instantiation? public class custoner f private string userwane; private string password; public custoner(string userwane, string password) f this. userwane = userwane; this.password = password; 3 pub1ic void setpassword(5tring password) f this.password = password; public string setpassword() f. return password; 3 public vold setuserwane(String userwane) \{ this, userwame = userwane; 3 pub1ic string getuserwame() f return usernane; 3 Given the following Person class: Which Tehant class would correctly inherit from Person and have a correct constructor defined? Which Tensit dass would correctly inherit fromt Person ond heve a coninct corictructor defined? publis elass Fenant extends formen f private string apartencitcode; private string cialt; tuper (firstilane, lantatios ) i. thitsionall = coadi; this -apartinentCode = apartasenteode; 3. 7 public elast fonant extenda farmen } prdvate. Starling apartisinticedo; private string onaity thats wetcath = ecaity this apartenentende = apartamititades super (f1rstaraes, lastano); 1 7 public class tonant extenda purion f pridake stering apartacultendey private itering traily Bublic class Tenent 1 private stering apartasitcodey pravate Staring fraily. this. firstilane = 1 Arstlinas this ilastekne o lastiline; this renail = eraily this wportancicode = apartanenticodep 3 13
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started