Skip to content

Closed scanner and changed a method to private #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Others/CountChar.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter your text: ");
String str = input.nextLine();

input.close();
System.out.println("There are " + CountCharacters(str) + " characters.");
}

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

public static int CountCharacters(String str) {
private static int CountCharacters(String str) {

int count = 0;

Expand Down