From 44e5047d74b9d7d7ec1513f56aebeb6c77b6e14a Mon Sep 17 00:00:00 2001 From: Derk-Jan Karrenbeld Date: Fri, 16 Feb 2024 10:01:10 +0100 Subject: [PATCH] Update tracks/java/exercises/gigasecond/mentoring.md Co-authored-by: Victor Goff --- tracks/java/exercises/gigasecond/mentoring.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tracks/java/exercises/gigasecond/mentoring.md b/tracks/java/exercises/gigasecond/mentoring.md index 34ca8a0b5..cb62b05b1 100644 --- a/tracks/java/exercises/gigasecond/mentoring.md +++ b/tracks/java/exercises/gigasecond/mentoring.md @@ -42,7 +42,10 @@ A student can choose to compute the result for `getDate()` in the constructor. I ### Exception handling -`plusSeconds` can throw a `java.time.DateTimeException`. A student may choose to catch this exception in the constructor, but this results in `birthDateTime` being null, so the class won't have been instantiated properly. There's no sensible default value that be stored in `birthDateTime`. It's better to let the exception be thrown, failing fast, and let calling code deal with it. +`plusSeconds` can throw a `java.time.DateTimeException`. +A student may choose to catch this exception in the constructor, but this results in `birthDateTime` being null, so the class won't have been instantiated properly. +There's no sensible default value that be stored in `birthDateTime`. +It's better to let the exception be thrown, failing fast, and let calling code deal with it. ### Type safety