Sealed class Item( val name: String) {
object Item1: Item("Mango")
object Item2: Item("Grapes")
}
How to add Item objects in a list with function?
Sample: val items = listOf( Item.Item1, Item.Item2)
g
Gama11
08/07/2021, 11:22 AM
not sure what you're after, can you clarify the question?