January 2018
Intermediate to advanced
434 pages
14h 1m
English
In the preceding example, we were sure that we can only have two types of toasts: an error toast and a toast with a custom message. So we created a sealed class ToastOperation and created two subclasses of ToastOperation. Note that if we aren't sure of types of subclasses, we will not use a sealed class, in that case, an enum class might be better suited.
Read now
Unlock full access