Skip to content

Commit 2d04adc

Browse files
Encapsulamiento
Encapsulamiento see also: resolves:
1 parent 6fe7ecb commit 2d04adc

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package dominio;
7+
8+
/**
9+
*
10+
* @author brian
11+
*/
12+
public class Persona {
13+
private String nombre;
14+
private double sueldo;
15+
private boolean eliminado;
16+
17+
public Persona(String nombre, double sueldo, boolean eliminado){
18+
this.nombre = nombre;
19+
this.sueldo = sueldo;
20+
this.eliminado = eliminado;
21+
22+
}
23+
24+
public String getNombre(){
25+
return this.nombre;
26+
}
27+
28+
public void setNombre(String nombre){ // set modificar
29+
this.nombre = nombre;
30+
}
31+
32+
33+
public double getSueldo(){
34+
return this.sueldo;
35+
}
36+
37+
public void setSueldo(double sueldo){ // set modificar
38+
this.sueldo = sueldo;
39+
}
40+
41+
public boolean isEliminado(){ //con los boolean no se usa get sino is
42+
return this.eliminado;
43+
}
44+
45+
public void setSueldo(boolean eliminado){ // set modificar
46+
this.eliminado = eliminado;
47+
}
48+
49+
50+
}

0 commit comments

Comments
 (0)