-
Notifications
You must be signed in to change notification settings - Fork 0
/
Person.java
43 lines (43 loc) · 1.03 KB
/
Person.java
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
abstract class Person{
private String name;
private String lang;
//inicializo el objeto
public Person(String n, String l){
this.name = n;
this.lang = l;
}
public abstract void greetings();
}
class Italian extends Person{
public Italian(String name){
super(name, "italian");
}
public void greetings(){
System.out.println("Ciao!!!");
}
public void makeSpachetti(){
System.out.println("Buonissimi!!!");
}
}
class Spanish extends Person{
public Spanish(String name){
super(name, "spanish");
}
public void greetings(){
System.out.println("Hola!!!");
}
public void makePaella(){
System.out.println("Rica rica!!!");
}
}
class Catalan extends Person{
public Catalan(String name){
super(name, "catalan");
}
public void greetings(){
System.out.println("Bon dia!!!");
}
public void makePatumaka(){
System.out.println("Qué bó!!!");
}
}