Java Practice It | Exercise 4.16: printPalindrome | if/else, input, method basics, Scanner, Strings

preview_player
Показать описание
More practice its:

Problem:

Question:
Write a method called printPalindrome that accepts a Scanner for the console as a parameter, and prompts the user to enter one or more words and prints whether the entered String is a palindrome (i.e., reads the same forwards as it does backwards, like "abba" or "racecar"). If the following Scanner object were declared:

printPalindrome(console);
Комментарии
Автор

Are you using the return statement to preemptively exit the loop?

dominikki
join shbcf.ru