Kotlin Training Program

DOWNLOAD APP

FEEDBACK

Object Oriented Programming

Object Oriented Programming is a programming paradigm in which classes and objects are used to encapsulate related data and functions into a single entity and provide abstraction.

Class & Object

Inheritance

Data class

Companion Object

Singleton

Interface

Abstract class

Enum class

Sealed class

Features

Data Encapsulation

Data Encapsulation is an important feature of OOPs that enables us to combine / put together related data and functions.

Abstraction

Functions provide a way to abstract implementation details. But OOPs provide next level abstraction through classes and objects.

TODO(“Abstraction Example”)

Suppose we have a function countWords(text: String): Int which counts & returns the number of words in the given text. By creating this function, we have abstracted the implementation details to the function. Once defined, this function helps us do what we want to do without knowing how to do it.

  • Polymorphism
  • Reusability
  • Data Security