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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 17:30, Annlee23
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
image
Computers and Technology, 24.06.2019 13:00, CarlosParker99
Think of a spreadsheet as a giant calculator spread of paper chart data collector
Answers: 2
image
Computers and Technology, 24.06.2019 18:00, aleyshamar14p95561
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best-suited for this?
Answers: 1
image
Computers and Technology, 25.06.2019 08:30, asapmechee
Uses an iterative process that repeats the design, expansion, and testing steps as needed, based on feedback from users.
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 in other subjects: