Code cleanup : fix C style array declaration.
[TP_POO.git] / Entiers / Entiers.java
index 4f1168ecad39fa68f87e52aee552e576ad7b4b43..4eddd73f6e79aef06c6c64b74a814ffcc524d409 100644 (file)
@@ -1,6 +1,6 @@
 
 class Entiers {
-    private int int_array[];
+    private int[] int_array;
     private int array_size;
     private int current_size;
 
@@ -60,14 +60,14 @@ class Entiers {
 
     private int binarySearch(int first, int last, int value) {
         if (last < first)
-            //FIXME: should not return an integer 
+            //FIXME: should not return an integer
             return -1;
         int middle = (first + last) / 2;
         if (value == int_array[middle])
             return middle;
         else if (value > int_array[middle])
             return binarySearch((middle + 1), last, value);
-        return binarySearch(first, (middle -1), value);
+        return binarySearch(first, (middle - 1), value);
     }
 
     public boolean supprimer(int value) {
@@ -98,7 +98,8 @@ class Entiers {
     }
 
     public void afficher() {
-        System.out.println("----");
+        String className = this.getClass().getSimpleName();
+        System.out.println("---- " + className + " ----");
         for (int i = 0; i < getCurrentSize(); i++) {
             System.out.println("element " + i + " " + int_array[i]);
         }