Skip to content

Commit 39baf67

Browse files
committed
Clase de prueba
1 parent daa820f commit 39baf67

File tree

1 file changed

+18
-0
lines changed
  • OpenBootcamp/Tema4/EjercicioPOO/src/pe/com

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package pe.com;
2+
/*
3+
En este ejercicio tendréis que crear una clase SmartDevice. Dentro crearéis las clases hijas: SmartPhone y SmartWatch.
4+
5+
Agregaréis atributos tal cual tendrían esos objetos en la realidad.
6+
7+
Crear constructor vacío y con todos los parámetros para cada clase.
8+
9+
Desde una clase Main: crearéis objetos de cada una y los utilizaréis para imprimir sus valores por consola.
10+
*/
11+
public class Main{
12+
public static void main(String[] args) {
13+
SmartPhone phone=new SmartPhone("45px", 120, "S20","SAMSUNG", 1559);
14+
SmartWatch watch=new SmartWatch("XYZ", "X456", "XIAOMY", 850);
15+
System.out.println(phone.toString());
16+
System.out.println(watch.toString());
17+
}
18+
}

0 commit comments

Comments
 (0)