-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.java
18 lines (17 loc) · 829 Bytes
/
App.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class App {
public static void main(String[] args) {
System.out.println("Inicio ejercicio de suma");
//Llamamos a función para sumar tres números:
System.out.println("10 + 20 + 30 = "+SumarTresNumeros.sumar(10, 20, 30));
System.out.println("Fin ejercicio de suma\n");
System.out.println("Inicio ejercicio de coche");
//Creamos objeto coche:
Coche cocheFamiliar = new Coche();
//El objeto coche trae por defecto 2 puertas:
System.out.println("El coche familiar no tiene: "+cocheFamiliar.getPuertas()+ " puertas");
//Agregamos 2 puertas más:
cocheFamiliar.setPuertas(2);
System.out.println("El coche familiar tiene: "+cocheFamiliar.getPuertas()+" puertas");
System.out.println("Fin ejercicio de coche");
}
}