forked from dharmanshu1921/Java
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPalindrome.java
More file actions
Latest commit
19 lines (15 loc) · 457 Bytes
/
Copy pathPalindrome.java
File metadata and controls
19 lines (15 loc) · 457 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
classMain {
publicstaticvoidmain(String[] args) {
Stringstr = "Radar", reverseStr = "";
intstrLength = str.length();
for (inti = (strLength - 1); i >=0; --i) {
reverseStr = reverseStr + str.charAt(i);
}
if (str.toLowerCase().equals(reverseStr.toLowerCase())) {
System.out.println(str + " is a Palindrome String.");
}
else {
System.out.println(str + " is not a Palindrome String.");
}
}
}