-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinterface2.java
More file actions
39 lines (37 loc) · 771 Bytes
/
interface2.java
File metadata and controls
39 lines (37 loc) · 771 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
interface first{
int a=10;
void show1();
}
interface second{
int b= 20;
void show2();
}
interface third{
int c = 30;
void show3();
}
class A implements first,second,third{
public void show1()
{
System.out.println("I am in interface 1");
System.out.println("the value of a = "+a);
}
public void show2()
{
System.out.println("I am in Interface 2");
System.out.println("the value of b = "+b);
}
public void show3()
{
System.out.println("I am in Interface 3");
System.out.println("the value of c = "+c);
}
}
public class interface2{
public static void main(String[] args) {
A obj = new A();
obj.show1();
obj.show2();
obj.show3();
}
}