https://kotlinlang.org logo
#android
Title
# android
r

Reena N

10/24/2017, 10:36 AM
@Paul Woitaschek package com.reenanachare.kosample /** * Defination of sealed class */ ‘sealed class SealedClass’
m

menegatti

10/24/2017, 11:10 AM
the children of a sealed class need to be on the same file
r

Reena N

10/24/2017, 11:27 AM
I got this line in tutorial ‘Note that classes which extend subclasses of a sealed class (indirect inheritors) can be placed anywhere, not necessarily in the same file.’
m

menegatti

10/24/2017, 11:29 AM
yeah, but note that this relates to classes that extend subclasses of a sealed class
a subclass of a sealed class needs to be in the same file
r

Reena N

10/24/2017, 11:30 AM
Thanks Edson, I would like to play more with sealed classes
m

menegatti

10/24/2017, 11:30 AM
Copy code
sealed class A
class B : A
B
needs to be on the same file as
A
Copy code
class C : B
C can be in a different file
r

Reena N

10/24/2017, 11:31 AM
Cool… its more clear now
3 Views