-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLemon.java
More file actions
44 lines (43 loc) · 719 Bytes
/
Lemon.java
File metadata and controls
44 lines (43 loc) · 719 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
class Tea{
public Tea()
{
System.out.println("Class Tea");
}
public void type(int a)
{
System.out.println("the type of drink rates:" +a);
}
}
class Green extends Tea{
public Green()
{
System.out.println("Class Green");
}
public void type(String s)
{
System.out.println("type: " +s);
}
public void taste()
{
System.out.println("bitter");
}
}
public class Lemon extends Green{
public Lemon()
{
System.out.println("Lemon");
}
public void taste()
{
System.out.println("citrus");
}
public static void main(String args[])
{
Lemon obj=new Lemon();
obj.type(10);
obj.type("Green");
obj.taste();
Green obj2=new Green();
obj2.taste();
}
}