Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Build a UML inheritance diagram with the following information: Consider the cla

ID: 3815037 • Letter: B

Question

Build a UML inheritance diagram with the following information: Consider the classes shown below: public class Parent {public void doSomethingO {/middot Implementation not shown middot/} public class Child extends Parent public void doAnotherThing() {/middot Implementation not shown middot/}} Which lines in the following code will compile without error? Explain your answer. Child kid -newChild(); kid.doSomething();//line 1 kid.doAnotherThing();//line 2 Line 1 only Line 2 only Lines 1 and 2 Neither line will compile without error

Explanation / Answer

Q8.
                                       Vehicle
                                       |
                                       |
       --------------------------------------------------------------------------
       |                                   |                                   |
   AirVehicle                           LandVehicle                           WaterVehicle
                                           |
                                       Auto


Q9)

   Child kid = new Child();

   kid.doSomething(); //line 1
   kid.doAnotherThing(); // line

As, Child is inheriting all public members of Parent class, so
   doSomething method is also available for child object


   Ans: c)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote