The Java Comparator interface's compare() method returns ______ if the two parameters are equal. 1 0 -1 true
Added by Gema B.
Close
Step 1
Step 1: Show more…
Show all steps
Your feedback will help us improve your experience
James Kiss and 91 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Consider a method that compares the elements of two ArrayLists and returns the value true if the elements in corresponding positions are equal, and returns false otherwise. Which of the following code will accomplish this? boolean temp = false; int i; for(i = 0; i < a.size(); i++) { if(a.get(i) == b.get(i)) { temp = true; } } return temp; int i; for(i = 0; i < a.size(); i++) { if(a.get(i) != b.get(i)) { return false; } else { return true; } } int i = 0; while(i < a.size() && a.get(i) == b.get(i)) { i++; } return (i == a.size()); boolean temp = true; int i; for(i = 0; i < a.size(); i++) { temp = (a.get(i) == b.get(i)); } return temp; int i = 0; while(i < a.size() && a.get(i) == b.get(i)) { i++; } if(i > a.size()) { return true; } return false;
James K.
-1= /8
Mukesh D.
comma-separated list. If there is no solution, enter NO SOLUTION. (Let k be any integer.) ASK YOUR TEACHER
Lauren S.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD