|
| 1 | +packagepaquete; |
| 2 | + |
| 3 | +//Creado Por: Jean Bernuy |
| 4 | + |
| 5 | +publicclassConstructores { |
| 6 | +intidUsuario; |
| 7 | +Stringusuario; |
| 8 | +Stringpassword; |
| 9 | + |
| 10 | +/*public Constructores(){ |
| 11 | + idUsuario= 1015; |
| 12 | + usuario="jean@gmail.com"; |
| 13 | + password="jean2"; |
| 14 | +
|
| 15 | + mostrar(); |
| 16 | +
|
| 17 | + }*/ |
| 18 | +publicConstructores(){} |
| 19 | + |
| 20 | +publicConstructores(intidUsuario){ |
| 21 | +this.idUsuario=idUsuario; |
| 22 | +usuario="jean@gmail.com"; |
| 23 | +password="jean2"; |
| 24 | + |
| 25 | +mostrar(); |
| 26 | + |
| 27 | + } |
| 28 | +publicConstructores(intidUsuario,Stringusuario){ |
| 29 | +this.idUsuario=idUsuario; |
| 30 | +this.usuario=usuario; |
| 31 | +password="jean2"; |
| 32 | + |
| 33 | +mostrar(); |
| 34 | + |
| 35 | + } |
| 36 | +publicvoidmostrar(){ |
| 37 | +System.out.println(idUsuario); |
| 38 | +System.out.println(usuario); |
| 39 | +System.out.println(password); |
| 40 | +System.out.println(); |
| 41 | +} |
| 42 | + |
| 43 | +publicstaticvoidmain(String[]args) { |
| 44 | +Constructorest=newConstructores(); |
| 45 | +Constructorest2=newConstructores(1120); |
| 46 | +Constructorest3=newConstructores(1123,"jean3@gmail.com"); |
| 47 | + |
| 48 | +} |
| 49 | + |
| 50 | +} |