Object-oriented programming with Kotlin
Object-oriented programming (OOP) is a very famous and widely used programming methodology. The Java programming language enables OOP with programming concepts such as classes, interfaces, abstraction, inheritance, polymorphism, encapsulation, and many more. The following sections will explain these concepts in Kotlin.
Learning about visibility modifiers
Visibility modifiers can be specified to classes, interfaces, constructors, functions, and properties. In Kotlin, the following visibility modifiers are available:
Visibility modifiers | Classes | Interfaces | Constructors | Functions | Properties |
| Visible only inside the file | Visible only inside the file | Visible only inside the file | Visible only inside the file | Visible only inside the file |
| Visible inside file and in subclasses | Visible inside file and in subclasses | Visible inside file and in subclasses | Visible inside file and in subclasses | Visible inside file and in subclasses |
| Visible everywhere inside the same module... |