-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpessoa.java
More file actions
55 lines (43 loc) · 932 Bytes
/
pessoa.java
File metadata and controls
55 lines (43 loc) · 932 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
45
46
47
48
49
50
51
52
53
54
55
package video;
public abstract class pessoa {
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public int getIdade() {
return idade;
}
public void setIdade(int idade) {
this.idade = idade;
}
public String getSexo() {
return sexo;
}
public void setSexo(String sexo) {
this.sexo = sexo;
}
public float getExperiencia() {
return experiencia;
}
public void setExperiencia(int experiencia) {
this.experiencia = experiencia;
}
protected String nome;
protected int idade;
protected String sexo;
protected int experiencia;
public pessoa(String nome, int idade, String sexo, float experiencia) {
this.nome = nome;
this.idade = idade;
this.sexo = sexo;
this.experiencia = 0;
}
protected void ganharExp() {
if(this.experiencia < 0) {
System.out.println(this.experiencia + 1);
}
System.out.println("operação invalida");
}
}