The purpose of extension functions is to add new functions to the existing class which means it can simply add functions to the class without declearing it inside the class. The new function actually behaves like static. It can become part of your own class (like Student) or can become part of the predefined class(like […]
Learn about Default function in Kotlin with suitable example here
In Java there is no concept of Default function .If you want to use your default function, which is already used in Kotlin,in your java you need to write @JvmOverloads for interoperability. Let see an example to make out- Ex- @file:JvmName(“MyCustomKotlinName”) fun main(args : Array<String>){ var result = findVolumn(2, 3) //height value has no need […]
How to use “when” expression in Kotlin programming language?
”when” is nothing but ‘Switch’ statement in C and Java language.There is also default case but this is expressed with else in When block.There is no break statement.We can attach multiple cases as well as a range(like 1…20) in one case.Also we can attach multiple condition in one case.The appropriate example is written below- fun […]
Android Things: Extension of an Android Platform
Android Thing is an extension of an Android platform for an IOT embedded device. We came to know about android in our phones for many years. Android is also available to us on smartwatches, TVs, and cars also. Now with android things, you can have android in any device that you can imagine. Android things […]