-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHillStationQues.java
52 lines (49 loc) · 1.35 KB
/
HillStationQues.java
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
abstract class HillStations{
abstract void location();
abstract void famousFor();
}
class Manali extends HillStations{
@Override
public void location(){
System.out.println("Manali is located in Himachal Pradesh");
}
@Override
public void famousFor(){
System.out.println("Manali is famous for Snow-capped-Mountains");
}
}
class Mussoorie extends HillStations{
@Override
public void location(){
System.out.println("Mussoorie is located in Uttrakhand");
}
@Override
public void famousFor(){
System.out.println("Manali is famous for mesmerizing waterfalls");
}
}
class Gulmarg extends HillStations{
@Override
public void location(){
System.out.println("Gulmarg is located in Jammu & Kashmir");
}
@Override
public void famousFor(){
System.out.println("Gulmarg is famous for Snow-capped-Mountains and Valleys");
}
}
public class HillStationQues {
public static void main(String[] args) {
Manali mn = new Manali();
mn.location();
mn.famousFor();
System.out.println();
Mussoorie ms = new Mussoorie();
ms.location();
ms.famousFor();
System.out.println();
Gulmarg gm = new Gulmarg();
gm.location();
gm.famousFor();
}
}