Skip to content

Commit

Permalink
A-Enums
Browse files Browse the repository at this point in the history
  • Loading branch information
LimAiLin committed Aug 24, 2022
1 parent dd73f2e commit b760b06
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,9 @@ protected void delete(String[] str) throws DukeException {
ls.remove(index);
}

protected void createFile() {
try {
File myObj = new File("tasks.txt");
if (myObj.createNewFile()) {
System.out.println("File created: " + myObj.getName());
} else {
System.out.println("File already exists.");
}
} catch (IOException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
}

protected void taskLoop() throws DukeException {
Scanner sc = new Scanner(System.in);
String curr = "";
createFile();

while (!Objects.equals(curr, "bye")) {
curr = sc.nextLine();
Expand Down

0 comments on commit b760b06

Please sign in to comment.