I have tried a few times to get this and I don\'t think its correct,please give
ID: 3614946 • Letter: I
Question
I have tried a few times to get this and I don't think its correct,please give me another opinion. With the first question, pleaseexplain the steps so I can better understand what it is im doingwrong.- What does this method do? Please describe the task accomplishedby this method.
public static char [] bar(String [] a)
{
char [] tmp = new char[a.length];
for (int i = 0; i < a.length; i++) {
if (a[i].length() > 0) {
tmp[i] = a[i].charAt(0);
}
else {
tmp[i] = ' ';
}
}
return tmp;
}
2. Write a class/static method that takes an array of ints as a
parameter and returns true if the number of positive values in
the array is greater than then number of negative values, and
false otherwise.