-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPessoa.java
More file actions
34 lines (33 loc) · 759 Bytes
/
Copy pathPessoa.java
File metadata and controls
34 lines (33 loc) · 759 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
public class Pessoa {
private String nome;
private char sexo;
private Data dtNasc;
public Pessoa(String nome, char sexo, Data dtNasc) {
this.nome = nome;
this.sexo = sexo;
this.dtNasc = dtNasc;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public char getSexo() {
return sexo;
}
public void setSexo(char sexo) {
this.sexo = sexo;
}
public Data getDtnasc() {
return dtNasc;
}
public void setDtnasc(Data dtNasc) {
this.dtNasc = dtNasc;
}
@Override
public String toString() {
return "Nome......: " + nome + "\nSexo......: " + sexo + "\nNascimento: " +
dtNasc.mostrarData(1) + " (" + dtNasc.calculaIdade() + " anos)";
}
}