subject

Public class Car { public void m1() {
System. out. println("car 1");
}
â
public void m2() {
System. out. println("car 2");
}
â
public String toString() {
return "vroom";
}
}

public class Truck extends Car {
public void m1() {
System. out. println("truck 1");
}
}

And assuming that the following variables have been declared:

Car mycar = new Car();
Truck mytruck = new Truck();

What is the output from the following statements?

a. Sound F/X System. out. println(mycar);
b. mycar. m1();
c. mycar. m2();
d. System. out. println(mytruck);
e. mytruck. m1();
f. mytruck. m2();

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
There is a simple pattern for determining if a binary number is odd. what is it and why does this pattern occur? how many bits would you need if you wanted to have the ability to count up to 1000? how high could you count in binary if you used all 10 of your fingers as bits? (finger up means 1, finger down means 0)
Answers: 3
question
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
You know the right answer?
Public class Car { public void m1() {
System. out. println("car 1");
}
â
pu...
Questions
question
Mathematics, 24.01.2020 22:31
question
English, 24.01.2020 22:31
Questions on the website: 13722362