Elvis operator in Kotlin
This operator is a question mark followed by a colon (?:) with no space in between. It is named for an emoticon (short form of “emotion icon”) of the musician Elvis Presley, and is also a play on the…
62 posts · page 6 of 8
This operator is a question mark followed by a colon (?:) with no space in between. It is named for an emoticon (short form of “emotion icon”) of the musician Elvis Presley, and is also a play on the…
In Kotlin, just like [extension function][extension-is-a-magic], properties can have extension properties too. The syntax is similar to extension functions - the extended type comes right before the…
The first time i was introduced to the term Generics was back in C++ STL (Standard Template Library) days. It was an idea to allow type (Int, String, Class, etc) to be a parameter to the class, funct…
Many times, you may encounter use cases where you need to return more than one item from a function. One way that people usually do is to create a custom object or class that contains those items.
One of main motivation of Kotlin is to reduce repetitive coding. One that many of us have spent a significant amount of time and effort is the class mechanism. However, creating classes that primaril…
If you are coming from C++, this may be familiar to you. The term Overload refers to the name of a function with the same name, but different numbers of parameters.
A large part of computer programming is performing an action when a pattern matches.
This is one of my most favorite features of Kotlin - Extension Function. Imagine this. You are using a 3rd party library - String that have all the things that I would need for text manipulation- alm…