Exercise: User Authentication
Enhance your Kotlin skills by implementing a structured approach for managing user authentication results.
We'll cover the following
Problem statement
Implement a sealed class hierarchy to represent the result of user authentication operations. The AuthResult
class can have two subclasses: AuthSuccess
and AuthFailure
. Additionally, introduce nullable types and use the Elvis operator to handle potential null values in the process.
Here is the provided class hierarchy:
Get hands-on with 1400+ tech skills courses.