The files at the links below contain source code for three interrelated classes,
ID: 3600674 • Letter: T
Question
The files at the links below contain source code for three interrelated classes, a Dog class, a DogOwner class, and a DogTester class that manipulates objects from the other two classes. DogTester.java DogOwner,java Dog.java Chuckles is an 8 kg spaniel who isn't a show dog. Jill, his owner, is a little nutty. She decides to change her name to "Darth" and Chuckles' name to "Lancelot. Write statements that accomplish this in the main method in the DogTester class: public class DogTester public static void main (Stringl arg) ( DogOwner jill; Dog d new Dog( Hotdog","poodle", 15.0, true) jilnew DogOwner(" Jill", d); Dog c = new Dog("Chuckles", "spaniel", 8.0, false); jill.setDog(c); lend main Wlend class CHECK ANSWERExplanation / Answer
Please find my answer. You have not posted the structure of Dog and DogOwner class, so check name of the setter methods.
1)
jill.setOwnerName("Darth");
c.setName("Lancelot");
2)
DogOwner jill;
jill = new DogOwner("jill", d);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.