Sealed Classes

This Atom is Under Construction

Kotlin allows you to constrain a class hierarchy by declaring the superclass as sealed.

All the subclasses of a sealed class must be located in the same file as the base class. This constraint prevents certain types of coding errors.

End of sample. See for full early-access book.

Previous          Next

©2018 Mindview LLC. All Rights Reserved.