Object Oriented Programming (OOPs)
© examsiri.com
Question : 31 of 72
Marks:
+1,
-0
1. public class Car {
2.  private int wheelCount;
3.  private String vin;
4.  public Car(String vin) {
5.   this.vin = vin;
6.   this.wheelCount = 4;
7.  }
8.  public String dnve() {
9.   return "zoom-zoom";
10.  }
11.  public String getInfo() {
12.   return "VIH: " + vin + " wheels: " + wheelCount;
13.  }
14. }
And:
1. public class MeGo extends Car {
2.  public MeGo(Stnng vin) {
3.   this.wheelCount = 3;
4.  }
5. }
Go to Question: