File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Unit14/src/unit14/Actividad22_Aplicacion Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ package unit14 .Actividad22_Aplicacion ;
2
+
3
+ import unit14 .Actividad15_Aplicacion .DAO .OficinaDAO ;
4
+ import unit14 .Actividad15_Aplicacion .Oficina ;
5
+ import unit14 .Funciones .GetData ;
6
+
7
+ import java .util .ArrayList ;
8
+
9
+ /*
10
+ Aprovecha el método de la Actividad 21 para mostrar las oficinas cuya superficie es superior a una
11
+ extensión introducida por teclado.
12
+ */
13
+ public class Actividad22 {
14
+ public static void main (String [] args ) {
15
+ OficinaDAO oficinaDAO = new OficinaDAO (); // Instancia de OficinaDAO
16
+ ArrayList <Oficina > oficinas = (ArrayList <Oficina >) oficinaDAO .readAll (); // ArrayList de oficinas
17
+
18
+ // Pedimos la superficie
19
+ int superficie = GetData .getInt ("Introduce la superficie: " , 1 , Integer .MAX_VALUE );
20
+
21
+ // Mostramos las oficinas cuya superficie es superior a la introducida
22
+ oficinas .stream ().filter (oficina -> oficina .getSuperficie () > superficie ).forEach (System .out ::println );
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments