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, 22.06.2019 06:00
Which of the following is a way that advancements in technology improve humans' ability to measure air quality and protect human health? a. air quality data gathered by new instruments can be used to reduce exposure to pollutants. b. new technologies enable natural and human-made pollution sources to be located and monitored. c. air quality data gathered by new instruments can be used to predict trends in pollution over time. d. new technologies allow governments to make informed decisions about the regulation of pollution. (choose more than one)
Answers: 2
question
Computers and Technology, 22.06.2019 15:20
The north and south regions had very diferent economies in the 1800s.
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 22.06.2019 19:10
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
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, 22.10.2019 07:00
question
Mathematics, 22.10.2019 07:00