I'm trying to take a list of strings from a user, store them in an array, and one-by-one, pass them through a function (oddPalindrome(results[i])) that returns a boolean indicating whether or not the string is a palindrome. Then it simply prints out whether that's a palindrome or not to the user. Below is the for loop I have constructed for it. I'm trying to figure out how to do this with a java stream, instead of a for-loop. Any help?
for (int i = 0; i < results.length; i++) {
System.out.print(results[i] + " ");
if (StringOperations.oddPalindrome(results[i])) {
System.out.println("is a palindrome");
} else {
System.out.println("is NOT a palindrome");
}
}