Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
String Palindrome
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { String str = "racecar"; String reverse = ""; int len = str.length(); for(int i = len - 1; i > -1; i--) reverse = reverse + str.charAt(i); if (str.equals(reverse)) { System.out.println("True"); } else { System.out.println("False"); } } }
run
|
edit
|
history
|
help
0
Catalan number optimised
om using stars
2B
Meena
jb14.0 tests
Armstrong Number in Java
hondaa11
SalesmenEarnings
Sorted Array
Split