An exhaustive switch on a sealed type covers the permitted subtypes the compiler knows about; it does not cover future additions, which can cause MatchException at run time. API authors should document the expected evolution of sealed types so that client code can choose how to handle future additions. It is almost never necessary to use default when switching over a sealed t...
Subscribe in seconds and receive Insidejava's news feed updates in your inbox, on your phone or even read them from your own news page here on follow.it.
You can select the updates using tags or topics and you can add as many websites to your feed as you like.
And the service is entirely free!
Follow Insidejava: Inside.java