subject

What is the output of the following code? public class inherit { abstract class speaker { abstract public void speak(); } class cat extends speaker { public void speak() { system. out. println("woof! "); } } class dog extends speaker { public void speak() { system. out. println("meow! "); } } inherit() { speaker d = new dog(); speaker c = new cat(); d. speak(); c. speak(); } public static void main(string[] args) { new inherit(); } }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:10
In mathematics and computer science, a set is a collection in which order does not matter and there are no duplicates. in this problem, we are going to to define a class which wil allow us to create an object to represent a set of integers. you will write a program set.java to define the class set. each instance of the class set will be an object representing a set of integers.
Answers: 3
question
Computers and Technology, 22.06.2019 04:00
Acetylene is a gas which burns rapidly on its own, and is considered highly explosive. a) true b) false
Answers: 2
question
Computers and Technology, 22.06.2019 11:30
Communication is the exchange of information. true false
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
You know the right answer?
What is the output of the following code? public class inherit { abstract class speaker { abstract...
Questions
question
Mathematics, 20.11.2019 06:31
Questions on the website: 13722363