-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCH_11_Interfaces.java
More file actions
40 lines (36 loc) · 848 Bytes
/
Copy pathCH_11_Interfaces.java
File metadata and controls
40 lines (36 loc) · 848 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
37
38
39
40
interface Bicycle{
int a=45;
void ApplyBreak(int decrement);
void SpeedUp(int increment);
}
interface HeroCycle{
void Horn();
void BlowHorn();
}
class AvonCycle implements Bicycle,HeroCycle{
void Cycle(){
System.out.println("poo poo poo");
}
public void ApplyBreak(int decrement){
System.out.println("Applying Break");
}
public void SpeedUp(int increment){
System.out.println("Increasing speed");
}
public void Horn(){
System.out.println("pee pee pee");
}
public void BlowHorn(){
System.out.println("poo poo poo");
}
}
public class CH_11_Interfaces {
public static void main(String[] args) {
AvonCycle cy =new AvonCycle();
cy.ApplyBreak(4);
cy.SpeedUp(1);
cy.Cycle();
cy.Horn();
cy.BlowHorn();
}
}