-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBike.java
More file actions
36 lines (36 loc) · 699 Bytes
/
Bike.java
File metadata and controls
36 lines (36 loc) · 699 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
29
30
31
32
33
34
35
36
class Bike {
int var=30;
int var2=50;
void accelerate()
{
System.out.println("hello i am Bike1 fxn");
}
}
class Bike2 extends Bike{
int var=20;
void accelerate()
{
System.out.println("hello i am Bike2 fxn");
}
}
class KTM extends Bike2{
int var=10;
void accelerate()
{
super.accelerate();
System.out.println("hello i am KTM function "+super.var);
System.out.println("hello i am KTM function "+super.var2);
}
/* void abc()
{
super.accelerate();
}*/
}
class Run
{
public static void main(String[] args) {
KTM obj=new KTM();
obj.accelerate();
// obj.abc();
}
}