App/Android Native
KOTLIN BASIC III (OOP)
Agrafenaaa
2021. 9. 23. 18:16
- Class, Object, Initializer
- Shadowing
it is useful for decoupling the code from other parts of the system(names are bound to the current scope).
- Get / Set
- Data Class
- Inheritance
- Interface (abstract variable/method + it could inherit from another interface)
- Abstract class
- non-instanitiated
- subclasses could inherit from it
- the members are NON-abstract unless the keyword <abstract> is declared
🧡💜 Abstract class vs interface
Abstract class | Interface | |
Constructor | O | X |
Multi-Inheritance | X | O |
Field | O | X |
- Typecasting
Reference : Kotlin Android Tutorial / tutorialsEU / Youtube or Udemy