I have provided a Selenium and Java programming challenge below to determine whether the values in an array are incremental. I have intentionally omitted one statement from the program. Your task is to identify the missing statement and mention it in the comments. You can check your answer by clicking the Solution button below.
import org.testng.annotations.Test;
public class SampleProgram7 {
@Test
public void testMySkills() {
int[] arr = {1, 5, 4, 3, 2 };
if(checkIncrementalArrray(arr)){
System.out.println("Array is incremental");
}
else{
System.out.println("Array is not incremental");
}
}
public Boolean checkIncrementalArrray(int[] arr) {
int len = arr.length;
for(int i=0;i<len-1;i++) {
if(arr[i] >= arr[i+1]){
return false;
}
}
}
}