Home / Tag Archives: Kotlin

Tag Archives: Kotlin

Kotlin Data Classes

In this tutorial we are going to discuss kotlin data classes, and show some examples on how you can use them in your app. We frequently create classes whose main purpose is to hold data. In such a case some standard functionality and utility functions are often mechanically derivable from …

Read More »

Kotlin Function Overriding Rules

Overridden functions of an open class is open by default and we can stop that by using the final Keyword Meaning we can override and inherit overridden method by default. Let’s say we built a learning app. Course is our abstract class, KotlinCourse inherits or extends Course, SpecialKotlinCourse also inherits or extend KotlinCourse. As you …

Read More »

Kotlin Interface Examples

Kotlin Interface Examples

An interface defines a contract for classes. An interface is similar to an Abstract class just that, an Abstract class is a collection of abstract methods and variables. Let’s say we have an interface called Driveable. interface Driveable { fun drive() // declaring 'abstract' is implicit and unnecessary } we can …

Read More »

Kotlin ArrayList and Loops Example

Kotlin ArrayList Kotlin ArrayList is also very similar to Java Arraylist. ArrayList<T> is the resizable-array implementation of the List interface. The ArrayList class has only a few methods in addition to the methods available in the List interface. val myArrayList = arrayListOf("John", "Fred", "McKinsey", "Morgan", "Sarah") //an arraylist of my friends val newFriendList …

Read More »

OOP: What is an Interface?

Object Oriented Programming- What is an Interface

An interface is a collection of abstract methods. An abstract method is a method that is declared but contains no implementation. With or without the keyword “abstract” on every function in an interface, as long as it does not have an implementation it is still an abstract Method. When a class implements an interface, it …

Read More »

What is Object Oriented Programing?

What is Object Oriented Programming

Object Orientation is the most widely used programming paradigm there is, every major programming language uses object-oriented programming principles and that includes Java, Python, C++, C#, PHP, Swift etc and it includes Kotlin. Objected Oriented Programming (OOP) dates back to the 1980s OOP is a natural way to model software …

Read More »