-
Notifications
You must be signed in to change notification settings - Fork 0
/
Segments.java
38 lines (31 loc) · 1.06 KB
/
Segments.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
public class Segments {
// Atributos da classe Segments
private int id; // Chave primária (PK)
private String description;
// Construtor da classe Segments
public Segments(int id, String description) {
this.id = id;
this.description = description;
}
// Métodos getters e setters para acessar e modificar os atributos
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
// Método principal para testar a classe
public static void main(String[] args) {
// Criando um objeto Segments
Segments segment1 = new Segments(1, "Segment A");
// Exibindo informações do segmento
System.out.println("Segment ID: " + segment1.getId());
System.out.println("Segment Description: " + segment1.getDescription());
}
}