subject

Consider the following classes: public class first { public void method2() { system. out. println("first2"); } public void method3() { method2(); }}public class second extends first { public void method2() { system. out. println("second2"); }}public class third extends second { public void method1() { system. out. println("third1"); super. method2(); } public void method2() { system. out. println("third2"); }}public class fourth extends first { public void method1() { system. out. println("fourth1"); } public void method2() { system. out. println("fourth2"); }}suppose the following variables are defined: first var1 = new second(); first var2 = new third(); first var3 = new fourth(); second var4 = new third(); object var5 = new fourth(); object var6 = new second(); indicate below the output that would be produced by each statement shown. if the statement produces more than one line of output, indicate the line breaks with slashes as in a/b/c to indicate three lines of output with a followed by b followed by c. if the statement causes an error, write the word error to indicate this. var1.method2(); var2.method2(); var3.method2(); var4.method2(); var5.method2(); var6.method2(); var1.method3(); var2.method3(); var3.method3(); var4.method3(); var5.method3(); var6.method3(); ((second) var4).method1(); ((third) var4).method1(); ((second) var5).method2(); ((first) var5).method3(); ((third) var5).method1(); ((first) var6).method3(); ((second) var6).method1(); ((second) var6).method3();

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, luclaymom805
Aplan to budget time for studying and activities is referred to as a study routine. study habits. study skills. a study schedule.
Answers: 1
image
Computers and Technology, 22.06.2019 19:10, kaiya789
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
image
Computers and Technology, 23.06.2019 11:00, jolleyrancher78
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, kyleemarie2003
Companies that implement and apply an information system effectively can create
Answers: 1
You know the right answer?
Consider the following classes: public class first { public void method2() { system. out. println("f...

Questions in other subjects:

Konu
Physics, 21.05.2021 16:40