fix: put more detailed comments in exception files
This commit is contained in:
@@ -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) {
|
||||
Reference in New Issue
Block a user