Skip to content

Commit

Permalink
modified Ui class
Browse files Browse the repository at this point in the history
  • Loading branch information
1-Karthigeyan-1 committed Oct 2, 2020
1 parent 0456e87 commit fc7047b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/duke/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
public class Ui {
private Scanner in;

/**
* Creates a new instance of scanner
*
* returns userInput
*/
public Ui() {
this.in = new Scanner(System.in);
}
Expand All @@ -17,11 +22,7 @@ public Ui() {
* @return user input
*/
public String readCommand(){
String userInput = null;
if(in.hasNextLine()) {
userInput = in.nextLine();
}
return userInput;
return in.nextLine();
}

/**
Expand Down

0 comments on commit fc7047b

Please sign in to comment.