- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegerpal_4.java
More file actions
Latest commit
23 lines (16 loc) · 587 Bytes
/
Copy pathintegerpal_4.java
File metadata and controls
23 lines (16 loc) · 587 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importjava.util.Scanner;
publicclassintegerpal_4 {
publicstaticvoidmain(String[] args) {
Scannerin=newScanner(System.in);
Stringstr=in.nextLine();
System.out.println(isPalindrome(str.toLowerCase()));
}
privatestaticbooleanisPalindrome(Stringoriginal) {
Stringreversed = "";
intlen = original.length();
for (inti = len - 1; i >= 0; i--) {
reversed = reversed + original.charAt(i);
}
returnoriginal.equals(reversed);
}
}