-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGratis.java
38 lines (29 loc) · 985 Bytes
/
Gratis.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
package Victor_Tesoura;
import java.text.DecimalFormat;
public final class Gratis extends Evento {
public static int cont = 0;
private int lotacao;
private DecimalFormat df;
public Gratis(byte codigo, String nome, String local, String data, String hora, char categoria, char tipo, int lotacao) {
super(codigo, nome, local, data, hora, categoria, tipo);
this.lotacao = lotacao;
//**Defesa**//incrementar variaveis estaticas no lugar correcto
cont++;
df = new DecimalFormat("#####0 pessoas");
}
public Gratis() {
this((byte) 0, "", "", "", "", ' ', ' ', 0);
}
public int getLotacao() {
return lotacao;
}
public void setLotacao(int lotacao) {
if (lotacao > 10) {
this.lotacao = lotacao;
}
}
@Override
public String toString() {
return super.toString() + ", Lotacao=" + df.format(lotacao);
}
}