Abhinay Gupta
Mar 20, 2024

--

The example for the sealed class can be used for sealed interfaces also.

sealed interface Result {

data class Success(val data: String) : Result

data class Error(val message: String) : Result

}

--

--

Abhinay Gupta

Exploring personal growth, tech, and culture through engaging storytelling | Inspiring and connecting with readers worldwide.