subject

Not all dogs like to bark, but some like to make a lot of noise! In this exercise we have a Dog superclass and a LoudDog subclass. You do not need to modify the Dog class. Your task is to write two override methods in the LoudDog class. You will override the speak method to return BARK! . You will then override the toString so that it returns Clover is loud and likes to BARK! where Clover is replaced by the name variable. Create and print at least one Dog and one LoudDog to test. Status: Not Submitted 9.3.6: Dogs Bark Save Submit + Continue iii FILES DogTester. java Dog. java LoudDog. java 1 public class Dog 2 - { 3 private String name; 4 5 public Dog(String name) { 6 this. name = name; 7 } 8 9 public String getName() { 10 return name; 11 } 12 13 public String speak() { 14 return "Bark!"; } 16 17 public String tostring() { 18 return name + likes to " 19 } 20 } + speak(); Status: Not Submitted 9.3.6: Dogs Bark FILES 1 public class LoudDog extends Dog 2 - { 3 4. public LoudDog(String name) { 5 super (name); 6 } 7 8 // override the speak method here 9 10 11 //override the tostring here. 1 //Remember, you can access the name using super. getName() 13 } 14 0 DogTester. java Dog. java LoudDog. java

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:40
What are the three uses of a screw?
Answers: 2
question
Computers and Technology, 23.06.2019 08:30
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
You know the right answer?
Not all dogs like to bark, but some like to make a lot of noise! In this exercise we have a Dog supe...
Questions
question
Mathematics, 06.09.2020 05:01
question
Biology, 06.09.2020 05:01
question
Spanish, 06.09.2020 05:01
question
Mathematics, 06.09.2020 05:01
question
Mathematics, 06.09.2020 05:01
question
Mathematics, 06.09.2020 05:01
Questions on the website: 13722367