Soumak De has Published 84 Articles

Difference between a "class" and an "object" in Kotlin

Soumak De

Soumak De

Updated on 23-Nov-2021 07:14:45

283 Views

Kotlin is a statistically typed language. It has been built over Java, hence it inherits all the object-oriented programming concepts of Java. In this article, we will see the difference between a "class" and an "object" in Kotlin.A "class" is a blueprint of a runtime entity and an "object" is ... Read More

When to use an inline function in Kotlin?

Soumak De

Soumak De

Updated on 23-Nov-2021 07:12:39

6K+ Views

Kotlin is a statistically typed language. It has different options to handle higher-order functions. Kotlin came up with a wonderful solution for higher-order functions by introducing inline functions.An Inline function is a kind of function that is declared with the keyword "inline" just before the function declaration. Once a function ... Read More

Difference between "*" and "Any" in Kotlin generics

Soumak De

Soumak De

Updated on 23-Nov-2021 07:09:47

2K+ Views

In any programming language, generics are a powerful feature using which developers can create custom data type to manipulate a program in a different manner. There are many ways in which we can define generics in Kotlin.In this article, we will demonstrate the difference between "*" and "Any" keywords in ... Read More

How to check "instanceof" class in Kotlin?

Soumak De

Soumak De

Updated on 23-Nov-2021 07:04:40

2K+ Views

Kotlin is a cross-platform, statistically typed, general-purpose programming language. It is very popular among the developer community because of its interoperable nature with JVM. In the programming world sometimes it is required to check the type of an object to implement a business logic.Unlike Java, we don't have an "instance ... Read More

What is the equivalent of Java static final fields in Kotlin?

Soumak De

Soumak De

Updated on 23-Nov-2021 07:01:54

519 Views

"static" is a Java keyword that helps developers to define a class member, whereas the keyword "final" is used to declare a constant variable in Java. Once a variable is declared as static in Java, the value of the variable remains unchanged in every instance of the object. Similarly, once ... Read More

How to clone or copy a list in Kotlin?

Soumak De

Soumak De

Updated on 23-Nov-2021 06:58:48

1K+ Views

A list is a type of collection in which data is stored in a sequential manner. We might come across a situation where the contents of one List have to be copied into another. In this article, we will see how to use Kotlin's built-in methods to clone a list.Example ... Read More

Difference between "fold" and "reduce" in Kotlin

Soumak De

Soumak De

Updated on 23-Nov-2021 06:54:27

905 Views

Kotlin is a cross-platform and statically typed general-purpose programming language. Kotlin provides many optional methods to traverse through the collections. fold() and reduce() are two different methods, both are helpful for traversing a collection. In this article, we will see how and when to use these two methods.Example – fold()If ... Read More

Try-with-resources in Kotlin

Soumak De

Soumak De

Updated on 23-Nov-2021 06:51:34

500 Views

Kotlin is very efficient in managing the memory. Unlike Java, developers in Kotlin need not have to manage the memory explicitly. We do have different kinds of memory management techniques and Try-with-resource is one of them. In Kotlin, we have a function called 'use' which takes the burden of managing ... Read More

'break' and 'continue' in forEach in Kotlin

Soumak De

Soumak De

Updated on 23-Nov-2021 06:48:01

4K+ Views

In Kotlin, we have three types of structural jump expressions: "break", "return", and "continue". In this article, we will see how break and continue work in Kotliln.Break - This is a keyword that helps in terminating an iteration, once a given condition is met, while traversing through a collection.Continue - ... Read More

Swift "if let" statement equivalent in Kotlin

Soumak De

Soumak De

Updated on 23-Nov-2021 06:28:11

2K+ Views

Swift "if let" is a conditional check operator to check whether a reference variable is NULL or not. This is a very useful technique to evaluate the unwrap optional value using swift language.In Kotlin, we can't use this operator directly. Instead, we will be using "let" and "run" to evaluate ... Read More

Advertisements