-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHuman.java
More file actions
32 lines (22 loc) · 1000 Bytes
/
Human.java
File metadata and controls
32 lines (22 loc) · 1000 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
package hw4;
public interface Human { //Interface
public void bodyParts(String topPart); //Abstract method no return type
public int eye(int eyeNo); //Abstract method with return type
void leg(double legNo); //parameters are allowed in abstract method in an Interface
void hand(double handNo);
void tail();
static void nature() { //Static and no-return method can be implemented in an Interface
System.out.println("Human nature is unstable");
}
default void nature(String a) { //Default method will not work due to java standard
System.out.println("Human mind is very Curious");
}
default void nature(String a) { //Default method will not work due to java standard
System.out.println("Human mind is very Curious"); // add method by ahmed
}
public static int legNhand(int legNo, int handNo) { //return method will not work due to java standard
int legNhand = legNo + handNo;
System.out.println(legNhand);
return legNhand;
}
}