10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73a504c commit eca4a40Copy full SHA for eca4a40
String Reversal/Palindrome.java
@@ -8,9 +8,7 @@ public static void main(String[] args){
8
word = sc.nextLine();
9
String[] wordArray = word.toUpperCase().split(" ");
10
String noBlanksWord="";
11
- int numCaracteres=0;
12
for(int i=0;i<wordArray.length;i++){
13
- numCaracteres+= wordArray[i 9090 ].length();
14
noBlanksWord+=wordArray[i];
15
}
16
@@ -19,6 +17,7 @@ public static void main(String[] args){
19
17
} else {
20
18
System.out.println("The sentence: " + word + " IS NOT a palindrome.");
21
+ sc.close();
22
23
24
@@ -48,4 +47,4 @@ public static boolean verifyWord(String word){
48
47
49
return isPalindrome;
50
51
-}
+}
0 commit comments