i have a little task in java generated from an exercise randomizer application. The instructions are:
Write a class named Vulgarist with a public identifier which must contain a public static method mes. This method gets as arguments a Vector type collection of Long and two tables with boolean type elements. The two tables and the collection have the same number of elements. The method returns as a result a Vector type collection of Long consisting of the elements of the collection of the first argument for which the corresponding element of the first table is the value true and the corresponding element of the second table is the value false.
My code is:
import java.util.Vector;
public class Vulgarist {
public static Vector<Long> mes(Vector<Long> v1, boolean a[], boolean b[]) {
Vector<Long> v2 = new Vector<>();
while ((v1.size() == b.length) && (v1.size() == a.length)
&& (a.length == b.length)) {
for (int i = 0; i <= a.length; i++) {
if ((a[i] == true) && (b[i] == false)) {
v2.add(v1.get(i));
}
}
}
return v2;
}
}
The result i get from the application is "The method mes was not implemented according to the instructions" Message Error : null
Can anyone help me find what i did wrong?