I am trying to figure out how to copy some elements from one array to newly created one.
I create an array arr, filter elements from another array str and if its elements match checkPalin
condition I want to add them into arr, but I struggle to do so, my IDE underscores arr array.
String [] arr;
for (int i=0; i<str.length; i++){
if(checkPalin(str[i])==true){
arr[i] = str[i];
}
}
return arr;