diff --git a/.idea/lab-java-interfaces-and-abstract-classes-es-RaulCortes.iml b/.idea/lab-java-interfaces-and-abstract-classes-es-RaulCortes.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/lab-java-interfaces-and-abstract-classes-es-RaulCortes.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..47478b9 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a8e02af --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..f0d05b8 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1719311907058 + + + + + + \ No newline at end of file diff --git a/src/Main.java b/src/Main.java new file mode 100644 index 0000000..c2d5522 --- /dev/null +++ b/src/Main.java @@ -0,0 +1,63 @@ +import inte.IntArrayList; +import inte.IntLIst; +import inte.IntVector; + +import vehicle.Truck; +import vehicle.UtilityVehicle; +import watch.Movie; +import watch.TvSeries; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +public class Main { + public static void main(String[] args){ + + Cine(); + + CarsInfo(); + + BD(); + + } + + private static void Cine() { + Movie n21 = new Movie("Spartacus", 114,87); + System.out.println(n21.getInfoVideo()); + + TvSeries ABC = new TvSeries("Fringe", 50,68); + System.out.println(ABC.getInfoVideo()); + } + + private static void CarsInfo() { + Truck n3 = new Truck("ES14515P","Ford","Focus",22000, 3000); + System.out.println(n3.getInfo()); + UtilityVehicle n34 = new UtilityVehicle("ES89741S","Renault","Megan",50000,true); + System.out.println(n34.getInfo()); + } + + private static void BD() { + BigDecimal a = new BigDecimal("4.2545").setScale(2,RoundingMode.HALF_DOWN); + + double b = a.doubleValue(); + System.out.println(b); + + BigDecimal x = new BigDecimal("1.2345").setScale(2, RoundingMode.HALF_DOWN).negate(); + double y = x.doubleValue(); + System.out.println(y); + + BigDecimal c = new BigDecimal("-45.67").setScale(1, RoundingMode.HALF_DOWN).negate(); + double d = c.doubleValue(); + System.out.println(d); + } + + + + IntArrayList IntArrayList = new IntArrayList(); + for(int i=0; i<10; i++) { + IntArrayList.add(i); + + IntVector IntVector = new IntVector(); + for(int i=0; i<20; i++) { + IntVector.add(i); +} \ No newline at end of file diff --git a/src/inte/IntArrayList.java b/src/inte/IntArrayList.java new file mode 100644 index 0000000..83de0bb --- /dev/null +++ b/src/inte/IntArrayList.java @@ -0,0 +1,42 @@ +package inte; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + + +public IntArrayList() implements IntLIst { + private Class[] array; + + array = new Class[10]; + System.out.println("There is " + array.length); + } + + public void add(int number) { + boolean newStudent = false; + + for (int i=0; i