Question: Complete the following program with inheritance concept of java programming. The program should have a subclass Car that inherits all the functionality of superclass Transport.

Complete the following program with inheritance concept of java programming. The program should have a subclass Car that inherits all the functionality of superclass Transport. Complete the program by identifying codes in (X), (Y) and (Z).

[5 marks]

class Transport { public void start_engine() { System.out.println("Start engine"); } public void move() { System.out.println("Now move"); } }

class ____(X)____ extends ____(Y)____ { public static void main(String[] args) { ____(Z)____ = new Transport ( ); car.start_engine(); car.move(); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!