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 the data.

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 can see from the code …

Kotlin Function Overriding Rules Read More »

Open & Abstract Classes and Inheritance in Kotlin

Kotlin: Open & Abstract Classes and Inheritance

In object-oriented programming, inheritance enables new objects to take on the properties of existing objects. We can have a class that can inherit properties and methods from the parent class when we inherit classes, we do not need to specify the method and properties again, in the new class (child class or subclass). In essence, it allows us to …

Kotlin: Open & Abstract Classes and Inheritance 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 = arrayListOf(“Musa”, “Victor”, “Timothy”) myArrayList.add(0, …

Kotlin ArrayList and Loops Example Read More »

Kotlin For Dummies: Variables, Basic Types, and Arrays

1. Variables In Kotlin, we use “val” to declare a constant or “var” keywords to declare a variable. You can specify a type such as String or Int after the variable name. In the example below, we declared a constant firstName of type String with the val keyword. val firstName: String = “Opeyemi” // this is …

Kotlin For Dummies: Variables, Basic Types, and Arrays Read More »

What is Object Oriented Programming

What is Object Oriented Programing?

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 and probably one of the …

What is Object Oriented Programing? Read More »