mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zanninso
feebbfeef1
|
1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago |
README.md
ListEquals
Instructions
Create a file ListEquals.java
.
Write a function areListsEqual
that returns true if the lists as parameters are equals. Returns false otherwise.
Expected Functions
import java.util.List;
public class ListEquals {
public static boolean areListsEqual(List<String> list1, List<String> list2) {
// your code here
}
}
Usage
Here is a possible ExerciseRunner.java to test your function :
import java.util.List;
public class ExerciseRunner {
public static void main(String[] args) {
System.out.println(ListEquals.areListsEqual(List.of("Alice", "Bob", "Charly", "Emily"), List.of("Alice", "Bob", "Charly", "Emily")));
System.out.println(ListEquals.areListsEqual(List.of("Alice", "Bob", "Charly", "Emily"), List.of("Alice", "Bob", "Emily", "Charly")));
}
}
and its output :
$ javac *.java -d build
$ java -cp build ExerciseRunner
true
false
$