- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterfMUlti.java
More file actions
Latest commit
53 lines (50 loc) · 880 Bytes
/
Copy pathinterfMUlti.java
File metadata and controls
53 lines (50 loc) · 880 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
41
42
43
44
45
46
47
48
49
50
51
52
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author g1.test1
*/
classa1
{
intx, y;
a1(intm,intn)
{
x=m;
y=n;
}
voiddisp()
{
System.out.println(x*y);
}
}
interfaceb1
{
intcon=54;
voidcompute(intf,intg);
voidcompute2(intk,intl);
}
classcextendsa1implementsb1
{
c(intm,intn)
{
super(m,n);
}
publicvoidcompute(intx,inty)
{
System.out.println("inside compute"+(x*y));
}
publicvoidcompute2(intk,intl)//all methods within interface must be in sub class
{
System.out.println("inside compute2"+(con*(k/2*l)));
}
}
publicclassinterfMUlti {
publicstaticvoidmain(Stringargs[])
{
cobj1=newc(1,2);
obj1.compute(20,34);
obj1.compute2(24,30);
}
}