This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.josphat.stateapp.screens | |
| import android.widget.Button | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.padding | |
| import androidx.compose.material3.Text | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.runtime.MutableState | |
| import androidx.compose.runtime.getValue | |
| import androidx.compose.runtime.mutableStateOf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## The key idea behind polymorphism is that objects of different classes can be treated as objects of a common superclass or interface. | |
| ##This enables you to write code that can work with objects of different types, as long as they adhere to the defined interface or inheritance hierarchy. | |
| ## EXAMPLE | |
| You might have a base class or interface called "Meal" that defines common properties and methods for different types of meals, such as breakfast, lunch, and dinner. | |
| Each specific meal type would be a derived class that inherits from the "Meal" base class or implements the "Meal" interface. | |
| ## Abstraction is a concept that focuses on hiding unnecessary details and complexity while providing a simplified view of an object or system. | |
| ## For example, you might have an abstract "Repository" class that defines methods for fetching data from the TMDB API, filtering meals, and providing meal plans. |