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.
2 parents 555b715 + 206b9aa commit 81d3e9bCopy full SHA for 81d3e9b
Others/CountChar.java
@@ -14,7 +14,7 @@ public static void main(String[] args) {
14
Scanner input = new Scanner(System.in);
15
System.out.print("Enter your text: ");
16
String str = input.nextLine();
17
-
+ input.close();
18
System.out.println("There are " + CountCharacters(str) + " characters.");
19
}
20
@@ -24,7 +24,7 @@ public static void main(String[] args) {
24
* @return int: Number of characters in the passed string
25
* */
26
27
- public static int CountCharacters(String str) {
+ private static int CountCharacters(String str) {
28
29
int count = 0;
30
0 commit comments