Fundamental Kotlin by Milos Vasic

Fundamental Kotlin by Milos Vasic

Author:Milos Vasic [Vasić, Miloš]
Language: eng
Format: epub
Tags: Kotlin, Programming, Language, Java, Essentials, Fundamentals, Development
Publisher: Milos Vasic
Published: 0101-01-01T00:00:00+00:00


A sealed class can have subclasses, but all of them must be nested inside the declaration of the sealed class itself.

Note that classes which extend subclasses of a sealed class (indirect inheritors) can be placed anywhere, not necessarily inside the declaration of the sealed class.

The key benefit of using sealed classes comes into play when you use them in a when expression. If it’s possible to verify that the statement covers all cases, you don’t need to add an else clause to the statement.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.