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

Author Question: The getValue() method is overridden in two ways. Which one is correct?I:public class Test { public ... (Read 20 times)

olgavictoria

  • Hero Member
  • *****
  • Posts: 528
The getValue() method is overridden in two ways. Which one is correct?

I:
public class Test {
public static void main(String[] args) {
A a = new A();
System.out.println(a.getValue());
}
}

class B {
public String getValue() {
return "Any object";
}
}

class A extends B {
public Object getValue() {
return "A string";
}
}

II:
public class Test {
public static void main(String[] args) {
A a = new A();
System.out.println(a.getValue());
}
}

class B {
public Object getValue() {
return "Any object";
}
}

class A extends B {
public String getValue() {
return "A string";
}
}

◦ I
◦ II
◦ Both I and II
◦ Neither


Related Topics

Need homework help now?

Ask unlimited questions for free

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

dreamfighter72

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




olgavictoria

  • Member
  • Posts: 528
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


scottmt

  • Member
  • Posts: 322
Reply 3 on: Yesterday
Excellent

 

Did you know?

In 1844, Charles Goodyear obtained the first patent for a rubber condom.

Did you know?

More than 150,000 Americans killed by cardiovascular disease are younger than the age of 65 years.

Did you know?

Signs of depression include feeling sad most of the time for 2 weeks or longer; loss of interest in things normally enjoyed; lack of energy; sleep and appetite disturbances; weight changes; feelings of hopelessness, helplessness, or worthlessness; an inability to make decisions; and thoughts of death and suicide.

Did you know?

Historic treatments for rheumatoid arthritis have included gold salts, acupuncture, a diet consisting of apples or rhubarb, nutmeg, nettles, bee venom, bracelets made of copper, prayer, rest, tooth extractions, fasting, honey, vitamins, insulin, snow collected on Christmas, magnets, and electric convulsion therapy.

Did you know?

More than 34,000 trademarked medication names and more than 10,000 generic medication names are in use in the United States.

For a complete list of videos, visit our video library