Question: Consider the following two automobile classes: Given the following declared variables, what is the output from the following statements? public class Car { public void
Consider the following two automobile classes:

Given the following declared variables, what is the output from the following statements?

public class Car { public void ml () { System.out.println ("car 1"); } public void m2 () { System.out.println ("car 2"); public String toString () { return "vroom"; } public class Truck extends Car { public void ml () { System.out..println ("truck 1"); }
Step by Step Solution
3.42 Rating (165 Votes )
There are 3 Steps involved in it
The following will be the output of the given code vroom car 1 car 2 vroom truck 1 car 2 Explanation ... View full answer
Get step-by-step solutions from verified subject matter experts
