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

Author Question: What is the output of running class Test?public class Test { public static void main(String[] args) ... (Read 50 times)

Mr3Hunna

  • Hero Member
  • *****
  • Posts: 536

Question 1

Suppose A is an abstract class, B is a concrete subclass of A, and both A and B have a default constructor. Which of the following is correct?
◦ B b = new A();
◦ A a = new A();
◦ A a = new B();
◦ B b = new B();

Question 2

What is the output of running class Test?

public class Test {
public static void main(String[] args) {
new Circle9();
}
}

public abstract class GeometricObject {
protected GeometricObject() {
System.out.print("A");
}

protected GeometricObject(String color, boolean filled) {
System.out.print("B");
}
}

public class Circle9 extends GeometricObject {
/** Default constructor */
public Circle9() {
this(1.0);
System.out.print("C");
}

/** Construct circle with a specified radius */
public Circle9(double radius) {
this(radius, "white", false);
System.out.print("D");
}

/** Construct a circle with specified radius, filled, and color */
public Circle9(double radius, String color, boolean filled) {
super(color, filled);
System.out.print("E");
}
}

◦ ABCD
◦ BACD
◦ BEDC
◦ CBAE
◦ AEDC


Related Topics

Need homework help now?

Ask unlimited questions for free

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

gabrielle_lawrence

  • Sr. Member
  • ****
  • Posts: 353
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 39% of students answer this correctly




Mr3Hunna

  • Member
  • Posts: 536
Reply 2 on: May 6, 2020
Gracias!


ricroger

  • Member
  • Posts: 352
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

There are major differences in the metabolism of morphine and the illegal drug heroin. Morphine mostly produces its CNS effects through m-receptors, and at k- and d-receptors. Heroin has a slight affinity for opiate receptors. Most of its actions are due to metabolism to active metabolites (6-acetylmorphine, morphine, and morphine-6-glucuronide).

Did you know?

Sildenafil (Viagra®) has two actions that may be of consequence in patients with heart disease. It can lower the blood pressure, and it can interact with nitrates. It should never be used in patients who are taking nitrates.

Did you know?

When blood is exposed to air, it clots. Heparin allows the blood to come in direct contact with air without clotting.

Did you know?

During pregnancy, a woman is more likely to experience bleeding gums and nosebleeds caused by hormonal changes that increase blood flow to the mouth and nose.

Did you know?

According to the National Institute of Environmental Health Sciences, lung disease is the third leading killer in the United States, responsible for one in seven deaths. It is the leading cause of death among infants under the age of one year.

For a complete list of videos, visit our video library