help needed urgently project work
nayomi21 (1)

an interactive java code asking a client to input a string and to test if the string is a palindrone

You are viewing a single comment. View All
AdobeZev (12)

I dont know java but I think I could help in explaining it.
When you get the prompt and the user answers the question you should take the first 3 chars and the last 3 chars. Reverse the last 3 chars and check if both of the words equal the same. (make sure you make them both lowercase) and set a bool as true

mwilki7 (794)

To add on to this answer, if you want an easy way to reverse a string in Java:

String mystr = "Hello";
String reversed = (new StringBuilder(mystr)).reverse().toString();

must have import java.lang.StringBuilder; imported first though.