-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVehicle.java
More file actions
28 lines (26 loc) · 992 Bytes
/
Vehicle.java
File metadata and controls
28 lines (26 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.automobile;
import com.automobile.*;
import com.automobile.twowheeler.Hero;
import com.automobile.twowheeler.Honda;
public abstract class Vehicle {
public abstract String getModelName();
public abstract String getRegistrationNumber();
public abstract String getOwnerName();
}
class Test{
public static void main(String[] args) {
Hero obj1 = new Hero();
Honda obj2 = new Honda();
System.out.println(obj1.getModelName());
System.out.println(obj1.getOwnerName());
System.out.println(obj1.getRegistrationNumber());
System.out.println(obj1.getSpeed());
obj1.radio();
System.out.println("...................................................");
System.out.println(obj2.getModelName());
System.out.println(obj2.getOwnerName());
System.out.println(obj2.getRegistrationNumber());
System.out.println(obj2.getSpeed());
obj2.cdplayer();
}
}