Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit81d3e9b

Browse files
authored
Merge pull requestTheAlgorithms#370 from GammaBurst101/change
Closed scanner and changed a method to private
2 parents555b715 +206b9aa commit81d3e9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Others/CountChar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static void main(String[] args) {
1414
Scannerinput =newScanner(System.in);
1515
System.out.print("Enter your text: ");
1616
Stringstr =input.nextLine();
17-
17+
input.close();
1818
System.out.println("There are " +CountCharacters(str) +" characters.");
1919
}
2020

@@ -24,7 +24,7 @@ public static void main(String[] args) {
2424
* @return int: Number of characters in the passed string
2525
* */
2626

27-
publicstaticintCountCharacters(Stringstr) {
27+
privatestaticintCountCharacters(Stringstr) {
2828

2929
intcount =0;
3030

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp