Guest User

Untitled

a guest
Jun 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public class Palindrome {
  2. public static void main(String[] args) {
  3. String txt = String.join("", args);
  4. String rvrs = new StringBuffer(txt).reverse().toString();
  5. String answ = new StringBuffer(String.join(" ", args)).reverse().toString();
  6. if(txt.toLowerCase().equals(rvrs.toLowerCase())){
  7. System.out.print("Yes, this is a palindrome!");
  8. } else System.out.print("Where did you find a palindrome here, you dumbass? "+answ);
  9. }
  10. }
Add Comment
Please, Sign In to add comment