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
Get step-by-step solutions from verified subject matter experts
