kotlin

kotlin

5 different Kotlin program to iterate through a mutablelist

Learn how to iterate through a mutablelist in kotlin. We will learn five different ways to iterate a mutablelist in this blog post.

Read
kotlin

Three different ways to create an empty string array in Kotlin

Three different ways to create one empty string array in Kotlin. We will use arrayOf, string constructor and arrayOfNull for that.

Read
kotlin

Extension function in Kotlin explanation with examples

This post will give you an introduction to kotlin extension function and how to use it with examples. Extension functions are used to add more functionality to a kotlin class easily.

Read
kotlin

repeat in Kotlin explanation with example

repeat is used to repeat any one function for a specific amount of time in Kotlin. This post will show you how to use repeat with example.

Read
kotlin

How to use default parameters in Kotlin constructor

Learn how to use default parameters in kotlin constructor and how to initialize a class by using default parameters.

Read
kotlin

Numbers in Kotlin and different useful methods

Learn how to use number in Kotlin with different methods defined in it. We will see its built-in types, different types of use cases with examples.

Read
kotlin

How to rethrow an exception in Kotlin

Using try catch finally, we can handle an exception. Rethrowing an exception is used to rethrow an exception again in the catch block. In this post, we will learn how to rethrow exception in kotlin with example.

Read
kotlin

How to handle exceptions using try catch in Kotlin

Learn how to handle exceptions in Kotlin using try catch with different examples. We will explore how to throw an exception and how to use try catch blocks to handle.

Read
kotlin

Kotlin example to use aggregate with groupingBy

groupingBy method is used to group items of a collection using a keySelector function. It returns one Grouping object. For example, we can group a list of strings by the first character of each string. aggregate is another function that can be used with a Grouping to apply one operation on each element of each group sequentially. In this post, I will show you how to use groupingBy with one example.

Read
kotlin

What is JvmStatic annotation in Kotlin and why we use it

JvmStatic annotation or @JvmStatic is an important annotation of Kotlin. In this post, I will show you where JvmStatic is used and its use cases.

Read