TP2: cast double to int the compare method returned value.
[TP_POO.git] / Structure / Entiers.java
index 4abf4f0ba8be2bda10cd4ff51851ab561ba0a6c0..80fcc9016434b0b5ec16c3f946c1999e37097fa3 100644 (file)
@@ -60,6 +60,7 @@ class Entiers extends Structure {
 
     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,7 +98,8 @@ class Entiers extends Structure {
     }
 
     public void afficher() {
-        System.out.println("---- entiers ----");
+        String className = this.getClass().getSimpleName();
+        System.out.println("---- " + className + " ----");
         for (int i = 0; i < getCurrentSize(); i++) {
             System.out.println("element " + i + " : " + int_array[i]);
         }