Chapter 3

  1. Inheritance is one of the key concepts in object-oriented programming that helps in avoiding code repetition, especially where different classes have common features and all the classes belong to the same type
  2. Encapsulation is an object-oriented programming technique that involves binding data and functions into one unit, which is called a class. All properties and functions of the class are tightly coupled and combined in a single place. 
  3. A visibility modifier helps to set the visibility of functions and properties to achieve encapsulation. A rule of thumb of encapsulation is to restrict those properties accessible to the outside the world and instead implement some functions to access them indirectly. Public, private, protected, and internal are four visibility modifiers provided by Kotlin.
  4. Kotlin provides four different types of inheritance:
    • Single inheritance 
    • Multi-level inheritance 
    • Hierarchical inheritance 
    • Hierarchical multi-level inheritance
  5. In object-oriented programming, polymorphism is a concept where a function behaves differently, depending on the type of object that calls it. Runtime polymorphism, which is also known as late or dynamic binding, is used to determine which method to invoke at runtime. 
  6. An abstract class is a generic concept and does not belong to a concrete idea. We do not create an instance of an abstract class; its only responsibility is to facilitate the creation of other classes. An abstract class is used to define which behaviors a class should have instead of how it should be implemented
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.78.83