Question: It is Java Program What will be the output of the given code? public class Ferrari extends Car public static void main(String[] args) { new
It is Java Program

What will be the output of the given code? public class Ferrari extends Car public static void main(String[] args) { new Ferrari(); 1 } public Ferrari ( 1 System.out.println("(4) Ferrari's no-arg constructor is invoked"); } } class Car extends Vehicle 1 public Car() { this("(2) Invoke Car's overloaded constructor"); System.out.println("(3) Car 's no-arg constructor is invoked"); 1 public Car (Strings) { System.out.println(s); 1 } class Vehicle public Vehicle() { System.out.println("(1) Vehicle's no-arg constructor is invoked"); 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
