Null Safety In Kotlin

In this blog we will take a look at how Kotlin handles null references. Kotlin is a cross-platform, statically typed, general-purpose programming language. Any language that has concept of null reference will have a possibility of throwing NullPointerException, Kotlin on the other hand is designed in such a way that it is really difficult to get a NullPointerException In this article we will make use of Java to compare how Kotlin behaves differently to null references....

April 24, 2022 · 6 min · 1199 words · Bhushan Sonawane

Lambdas in Kotlin

Lambdas are nothing but anonymous functions; a function without a name, meaning they are function defined without fun keyword and we are allowed to assign them to variables or pass them as functional parameters. In Kotlin we define a lambda as follows: var lambda1 = { name: String -> println('Hello, my name is $name') } In above example name is the input parameter to our lambda function and the statement after -> is body of our lambda function and we have assigned the lambda to lambda1 variable....

May 13, 2022 · 3 min · 557 words · Bhushan Sonawane