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, 23.06.2019 09:30
After you present a proposal, the committee starts asking you questions, some beyond the strict focus of your proposal. they ask questions about implications in other fields and knowledge about other fields. you are asked to redo your proposal. what is most likely missing? breadth of material depth of material clarity of material details of material
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
How are we able to create photographs differently than 100 years ago? explain your answer in relation to your photograph you selected.
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is: censoredex: if userinput is "dang, that was scary! ", then output is: dang, that was scary! note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.#include #include using namespace std; int main() {string userinput; getline(cin, userinput); int ispresent = userinput.find("darn"); if (ispresent > 0){cout < < "censored" < < endl; /* your solution goes here */return 0; }
Answers: 3
question
Computers and Technology, 24.06.2019 13:50
What does code do? a creates a text box that says "solid black" b creates a black border of any width c creates a black border 1 pixel wide
Answers: 1
You know the right answer?
Public class Car { public void m1() {
System. out. println("car 1");
}
â
pu...
Questions
question
German, 27.09.2021 07:20
question
Mathematics, 27.09.2021 07:20
question
Mathematics, 27.09.2021 07:20
question
Mathematics, 27.09.2021 07:20
Questions on the website: 13722362