TP2: cast double to int the compare method returned value.
[TP_POO.git] / Entiers / Entiers.java
index 7251eb5f7d87b9a2e3cb51c7508ae2ad77b0c029..c878f631f68df145245bfd0a76ced4fef095a790 100644 (file)
@@ -60,6 +60,7 @@ class Entiers {
 
     private int binarySearch(int first, int last, int value) {
         if (last < first)
+            //FIXME: should not return an integer
             return -1;
         int middle = (first + last) / 2;
         if (value == int_array[middle])
@@ -97,8 +98,9 @@ class Entiers {
     }
 
     public void afficher() {
-        System.out.println("----");
-        for (int i = 0; i < getSize(); i++) {
+        String className = this.getClass().getSimpleName();
+        System.out.println("---- " + className + " ----");
+        for (int i = 0; i < getCurrentSize(); i++) {
             System.out.println("element " + i + " " + int_array[i]);
         }
     }