File tree Expand file tree Collapse file tree 7 files changed +192
-0
lines changed Expand file tree Collapse file tree 7 files changed +192
-0
lines changed Original file line number Diff line number Diff line change
1
+ package paquete ;
2
+
3
+ public class BeansPrincipal {
4
+
5
+ public static void main (String [] args ) {
6
+
7
+ JavaBeans obj = new JavaBeans ();
8
+
9
+ obj .setUsuario ("jean@gmail.com" );
10
+ obj .setPassword ("esta es una contraseña" );
11
+ obj .setCodigo (121 );
12
+
13
+ System .out .println (obj .getUsuario ());
14
+ System .out .println (obj .getPassword ());
15
+ System .out .println (obj .getCodigo ());
16
+
17
+ }
18
+
19
+ }
Original file line number Diff line number Diff line change
1
+ package paquete ;
2
+
3
+ //Creado Por: Jean Bernuy
4
+
5
+ public class Constructores {
6
+ int idUsuario ;
7
+ String usuario ;
8
+ String password ;
9
+
10
+ /*public Constructores(){
11
+ idUsuario= 1015;
12
+ usuario="jean@gmail.com";
13
+ password="jean2";
14
+
15
+ mostrar();
16
+
17
+ }*/
18
+ public Constructores (){}
19
+
20
+ public Constructores (int idUsuario ){
21
+ this .idUsuario =idUsuario ;
22
+ usuario ="jean@gmail.com" ;
23
+ password ="jean2" ;
24
+
25
+ mostrar ();
26
+
27
+ }
28
+ public Constructores (int idUsuario , String usuario ){
29
+ this .idUsuario =idUsuario ;
30
+ this .usuario =usuario ;
31
+ password ="jean2" ;
32
+
33
+ mostrar ();
34
+
35
+ }
36
+ public void mostrar (){
37
+ System .out .println (idUsuario );
38
+ System .out .println (usuario );
39
+ System .out .println (password );
40
+ System .out .println ();
41
+ }
42
+
43
+ public static void main (String [] args ) {
44
+ Constructores t =new Constructores ();
45
+ Constructores t2 =new Constructores (1120 );
46
+ Constructores t3 =new Constructores (1123 ,"jean3@gmail.com" );
47
+
48
+ }
49
+
50
+ }
Original file line number Diff line number Diff line change
1
+ package paquete ;
2
+
3
+ public class HolaMundo {
4
+
5
+ /**
6
+ * Creado Por: Jean Bernuy
7
+ */
8
+ public static void main (String [] args ) {
9
+
10
+ /* Tipo de variables
11
+ String texto="";
12
+ double var;
13
+ int var1;
14
+ char var2;
15
+ boolean var3;
16
+ long var4;
17
+ short var5;
18
+ */
19
+
20
+ System .out .println ("Hola Mundo..." );
21
+
22
+
23
+ }
24
+
25
+ }
Original file line number Diff line number Diff line change
1
+ package paquete ;
2
+ import java .io .*;
3
+
4
+ public class IOdeDatos {
5
+
6
+ public static void main (String [] args ) throws Exception {
7
+ String texto ;
8
+
9
+ //Clase BufferedReader
10
+ InputStreamReader flujo = new InputStreamReader (System .in );
11
+ BufferedReader caracteres = new BufferedReader (flujo );
12
+
13
+ System .out .println ("Ingrese una palabra" );
14
+ texto =caracteres .readLine ();
15
+
16
+ System .out .println (texto );
17
+
18
+ //Clase PrintStrem
19
+ PrintStream salida = new PrintStream (System .out );
20
+ salida .println ("Esta es la clase PrintStream" );
21
+
22
+ }
23
+
24
+ }
Original file line number Diff line number Diff line change
1
+ package paquete ;
2
+
3
+
4
+ public class JavaBeans {
5
+
6
+ public String usuario ;
7
+ private String password ;
8
+ private int codigo ;
9
+
10
+ public void setUsuario (String usuario ){
11
+ this .usuario =usuario ;
12
+ }
13
+ public String getUsuario (){
14
+ return usuario ;
15
+ }
16
+
17
+ public String getPassword () {
18
+ return password ;
19
+ }
20
+ public void setPassword (String password ) {
21
+ this .password = password ;
22
+ }
23
+ public int getCodigo () {
24
+ return codigo ;
25
+ }
26
+ public void setCodigo (int codigo ) {
27
+ this .codigo = codigo ;
28
+ }
29
+
30
+ }
Original file line number Diff line number Diff line change
1
+ package paquete ;
2
+
3
+ //Creado Por: Jean Bernuy
4
+
5
+ public class Objetos {
6
+
7
+ public static void main (String [] args ) {
8
+
9
+ //varibles
10
+
11
+ /*String nombre="bicicleta";
12
+ String color="azul";
13
+ int codigo= 1001;
14
+
15
+ String nombre2="moto";
16
+ String color2="negro";
17
+ int codigo2=1002;
18
+ */
19
+
20
+ Tienda t ;
21
+ t =new Tienda ();
22
+ t .nombre ="bicicleta" ;
23
+ t .color ="azul" ;
24
+ t .codigo =1001 ;
25
+
26
+ Tienda t2 = new Tienda ();
27
+ t2 .nombre ="moto" ;
28
+ t2 .color ="rojo" ;
29
+ t2 .codigo =1002 ;
30
+
31
+ Tienda t3 = new Tienda ();
32
+ t3 .nombre =" jose" ;
33
+
34
+ }
35
+
36
+ }
Original file line number Diff line number Diff line change
1
+ package paquete ;
2
+
3
+ public class Tienda {
4
+
5
+ String nombre ;
6
+ String color ;
7
+ int codigo ;
8
+ }
You can’t perform that action at this time.
0 commit comments