- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHuman.java
More file actions
Latest commit
29 lines (19 loc) · 861 Bytes
/
Copy pathHuman.java
File metadata and controls
29 lines (19 loc) · 861 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
packagehw4;
publicinterfaceHuman { //Interface
publicvoidbodyParts(StringtopPart); //Abstract method no return type
publicinteye(inteyeNo); //Abstract method with return type
voidleg(doublelegNo); //parameters are allowed in abstract method in an Interface
voidhand(doublehandNo);
voidtail();
staticvoidnature() { //Static and no-return method can be implemented in an Interface
System.out.println("Human nature is unstable");
}
defaultvoidnature(Stringa) { //Default method will not work due to java standard
System.out.println("Human mind is very Curious");
}
publicstaticintlegNhand(intlegNo, inthandNo) { //return method will not work due to java standard
intlegNhand = legNo + handNo;
System.out.println(legNhand);
returnlegNhand;
}
}