fix: put more detailed comments in exception files

This commit is contained in:
2026-05-15 17:37:28 +03:30
parent 30eca2a7a5
commit 015840161b
2 changed files with 13 additions and 3 deletions
+12 -2
View File
@@ -49,18 +49,26 @@ public class FileService {
public static String writeFile(UserEntity user) {
//TODO: Uncomment the lines below.
//TODO: Use your knowledge of exception handling to make the code work as expected
/* Uncomment this section
//TODO: handle the exception
FileWriter fw = new FileWriter("userInformation.txt", true);
BufferedWriter bw = new BufferedWriter(fw);
bw.write(user.toString());
bw.close();
*/
return "user information written to file";
}
public static void readFile() {
//TODO: Uncomment the lines below.
//TODO: Use your knowledge of exception handling to make the code work as expected
/* Uncomment this section
FileReader file = new FileReader("userInformation.txt");
BufferedReader fileInput = new BufferedReader(file);
@@ -69,6 +77,7 @@ public class FileService {
System.out.println(fileInput.readLine());
fileInput.close();
*/
}
@@ -77,8 +86,9 @@ public class FileService {
Date dob = null;
dob = formatter.parse(date);
//TODO: Uncomment this line.
//TODO: Use your knowledge of exception handling to make the code work as expected
//dob = formatter.parse(date);
return dob;
}
@@ -1,4 +1,4 @@
package org;
package org.exceptions;
public class Main {
public static void main(String[] args) {