Identify the missed statement in the Code – Selenium with Java challenge 7

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;
        }
    }
    
}

}

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Testingtalkslatest.com - A project by CreativeHub IT Solutions.
Contact Us At: support@testingtalkslatest.com
Our Partner websites - Classified Hub , CodesToolbox , CodesToolbox
Scroll to Top
0
Would love your thoughts, please comment.x
()
x