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

Author Question: Analyze the following code:public class A extends B {}class B { public B(Strign s) { }} (Read 54 times)

hbsimmons88

  • Hero Member
  • *****
  • Posts: 526
Analyze the following code:

public class A extends B {
}

class B {
public B(Strign s) {
}
}

◦ The program would compile fine if you add the following constructor into A: A(String s) { }
◦ The program would compile fine if you add the following constructor into A: A(String s) { super(s); }
◦ The program has a compilation error because A does not have a default constructor.
◦ The program has a compilation error because the default constructor of A invokes the default constructor of B, but B does not have a default constructor.


Related Topics

Need homework help now?

Ask unlimited questions for free

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

ladyjames123

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




hbsimmons88

  • Member
  • Posts: 526
Reply 2 on: May 6, 2020
Great answer, keep it coming :)


upturnedfurball

  • Member
  • Posts: 334
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

The Babylonians wrote numbers in a system that used 60 as the base value rather than the number 10. They did not have a symbol for "zero."

Did you know?

The ratio of hydrogen atoms to oxygen in water (H2O) is 2:1.

Did you know?

The first-known contraceptive was crocodile dung, used in Egypt in 2000 BC. Condoms were also reportedly used, made of animal bladders or intestines.

Did you know?

The most dangerous mercury compound, dimethyl mercury, is so toxic that even a few microliters spilled on the skin can cause death. Mercury has been shown to accumulate in higher amounts in the following types of fish than other types: swordfish, shark, mackerel, tilefish, crab, and tuna.

Did you know?

The average office desk has 400 times more bacteria on it than a toilet.

For a complete list of videos, visit our video library