📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!

  • google app store apple app store

    • Question

      Complete the Java method to check if an integer array

      arr is empty. public class ArrayChecker {     public boolean isEmpty(int[] arr) {         _________ // Line to complete     } }
      A return arr.length == 0; Correct Answer Incorrect Answer
      B return arr.size() == 0; Correct Answer Incorrect Answer
      C return arr == null; Correct Answer Incorrect Answer
      D return arr.isEmpty(); Correct Answer Incorrect Answer
      E return arr.length < 1; Correct Answer Incorrect Answer

      Solution

      The correct answer is A

      Practice Next
      ask-question