-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInterface.java
More file actions
38 lines (37 loc) · 809 Bytes
/
Interface.java
File metadata and controls
38 lines (37 loc) · 809 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
import java.util.*;
interface Woods{
void thick(int len1);
void thin(int len2);
int a=10;
}
interface Metal{
void hard();
void soft();
}
class Sandalwood implements Woods,Metal{
public void thick(int len1){
System.out.println(len1);
System.out.println("Thick wood");
}
public void thin(int len2){
System.out.println(len2);
System.out.println("Thin wood");
}
public void hard(){
System.out.println("Hard metal");
}
public void soft(){
System.out.println("Soft metal");
}
}
class Interface{
public static void main(String[] args)
{
Sandalwood obj = new Sandalwood();
obj.thick(20);
obj.thin(21);
System.out.println(obj.a);
obj.hard();
obj.soft();
}
}