Open JangusRoundstone opened 1 year ago
I think its just to ensure the main class you are running is cleaner.
Could always break up your exceptions into several different exception packages to further classify them and would be much easier to reference
In the 3rd key exercise in week 5, IllegalShapeException given is defined without the static keyword. From what I found the convention is indeed to define exception as a public class, and not as a static nested class inside the main class.
May I know why that is the case? Are there uses to exceptions defined as static nested class inside main? Based on my understanding, static nested exception class could potentially be useful for defining very specific exception that is exclusive to current main class you are running.
Any thoughts are welcomed!