In continuation to my last Medium post Extensions in Kotlin where I explained what are Extensions and how do we use it, this medium post will cover the implementation of Extensions as members of some other class. …
Unlike Java or C#, Kotlin doesn’t have static members or member functions. Kotlin recommends to simply use package-level functions instead. …
Object creation is a heavy process. When we create a class object, all the public and private properties of that class are initialised inside the constructor. …
In continuation to my previous blogs Native Android in Unity, will consider another example of native Android text sharing functionality in the unity app. …
While developing unity games in C# targeting android platform, we always want to use few native android features in our game. …
What if I say there is a class called Nothing in Koltin. And What does it do? Nothing. The time I read about the class Nothing for the first time, it sounds interesting to me. …
Any expression in Kotlin may be marked with a label. This can be used to as an identifier. A label can be defined in Kotlin using label name followed by @ sign in front of any expression. …
It is a very common use case where we want to return two values from a method, can be either of same data type or can be of different data types. …
I started developing Android apps in Java where encapsulation of object-oriented programming was achieved through declaring variables as private fields with their getter and setter as public methods. …
While converting all my java code to kotlin, one of the strange syntax change I observed was the for loop in both the languages. …
when operator is a replacement of switch operator in other languages. when operator matches its argument with all the branches until it matches with anyone, else it executes the else block. …
‘in’ operator in Koltin is used to check the existence of particular variable or property in a Range or Collection whereas a ‘! …
Type check is a way of checking the type(DataType) or Class of a particular instance or variable while runtime to separate the flow for different objects. …
In Kotlin, the type system distinguishes between references that can hold null (nullable references) and those that can not (non-null references). …
There can be two ways to declare and initialize a var property var variable : CustomClass = CustomClass() or var variable : CustomClass? …
What is a higher-order function? In Kotlin, a function can be passed as a parameter or can be returned from a function, the function which does the same is known as a higher-order function. …
What is Backing Field ? Backing field is an autogenerated field for any property which can only be used inside the accessors(getter or setter) and will be present only if it uses the default implementation of at least one of the accessors, or if a custom accessor references it through the field identifier. …