This topic contains a solution. Click here to go to the answer

Author Question: Show the output of running the class Test in the following code lines:interface A {}class C { }class ... (Read 44 times)

arivle123

  • Hero Member
  • *****
  • Posts: 569

Question 1

Which of the following is incorrect?
◦ The constructors in an abstract class should be protected.
◦ You may declare a final abstract class.
◦ An abstract class contains constructors.
◦ The constructors in an abstract class are private.
◦ An interface may contain constructors.

Question 2

Show the output of running the class Test in the following code lines:

interface A {
}

class C {
}

class B extends D implements A {
}

public class Test {
public static void main(String[] args) {
B b = new B();
if (b instanceof A)
System.out.println("b is an instance of A");
if (b instanceof C)
System.out.println("b is an instance of C");
}
}

class D extends C {
}

◦ b is an instance of C.
◦ b is an instance of A followed by b is an instance of C.
◦ Nothing.
◦ b is an instance of A.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by arivle123 on May 6, 2020

mistyjohnson

  • Sr. Member
  • ****
  • Posts: 331
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 50% of students answer this correctly




arivle123

  • Member
  • Posts: 569
Reply 2 on: May 6, 2020
Thanks for the timely response, appreciate it


recede

  • Member
  • Posts: 315
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

The toxic levels for lithium carbonate are close to the therapeutic levels. Signs of toxicity include fine hand tremor, polyuria, mild thirst, nausea, general discomfort, diarrhea, vomiting, drowsiness, muscular weakness, lack of coordination, ataxia, giddiness, tinnitus, and blurred vision.

Did you know?

One way to reduce acid reflux is to lose two or three pounds. Most people lose weight in the belly area first when they increase exercise, meaning that heartburn can be reduced quickly by this method.

Did you know?

As the western states of America were settled, pioneers often had to drink rancid water from ponds and other sources. This often resulted in chronic diarrhea, causing many cases of dehydration and death that could have been avoided if clean water had been available.

Did you know?

Children of people with alcoholism are more inclined to drink alcohol or use hard drugs. In fact, they are 400 times more likely to use hard drugs than those who do not have a family history of alcohol addiction.

Did you know?

Pope Sylvester II tried to introduce Arabic numbers into Europe between the years 999 and 1003, but their use did not catch on for a few more centuries, and Roman numerals continued to be the primary number system.

For a complete list of videos, visit our video library