Не проходит 1 требование, как только в условии не указывал
if (Index >= 0)
if (Index > 0)
if (Index > -1)
------------------------------
В чем может быть ошибка?
package com.javarush.task.pro.task05.task0519;
import java.util.Arrays;
/*
Есть ли кто?
*/
public class Solution {
public static int[] array = {9, 8, 7, 6, 5, 4, 3, 2, 1};
public static int element = 5;
public static void main(String[] args) {
//напишите тут ваш код
int[] a = Arrays.copyOf(array, array.length);
Arrays.sort(a);
int Index = Arrays.binarySearch(a, element);
for (Index = 0; Index < a.length; Index++) {
}
if (Index > 0) {
System.out.print("true");
}
else {
System.out.print("false");
}
}
}