I'm new to Java. I'm getting the following error from my code:
(Palindrome.jav a:30: error: missing return statement
} // close method)
My code is:
[public class Palindrome { // define class palindrome
public static boolean isPalindrome(St ring inputWord) { //define method
int rightSide = inputWord.lengt h() -1; // right side
while (leftSide...
User Profile
Collapse
-
I'm getting a return statement error
-
Heyjude579 started a topic how do I code to check if a string does not equal another string? a value?in Javahow do I code to check if a string does not equal another string? a value?
I understand how to use the equals, and know that there is an option to use '!' for unequal check, but in my case, I am testing against a value in quotes. See my code below.... how do I use the '!' to check against a value in quotes? I also would like to change this test to a while loop, rather than an if/else. I am hoping this will still work in that case (??)
if ("quit".equals( inputWord)) { // checks for string=quit....
No activity results to display
Show More