In Smart Casting, we generally use is or !is an operator to check the type of variable, and the compiler automatically casts the variable to… Read More
Category Archives: Kotlin
Type Checking – In Kotlin, we can check the type of certain variable using the is operator at runtime. It is a way of checking… Read More
Kotlin’s type system is aimed to eliminate the jeopardy of null reference from the code because it is a billion dollar mistake. NullPointerExceptions are thrown… Read More
Kotlin provides an important new type of class that is not present in Java. These are known as sealed classes. As the word sealed suggests,… Read More
In Kotlin, an interface is a collection of abstract methods and properties that define a common contract for classes that implement the interface. An interface… Read More
Generics are the powerful features that allow us to define classes, methods and properties which are accessible using different data types while keeping a check… Read More
An exception is an unwanted or unexpected event, which occurs during the execution of a program i.e at run time, that disrupts the normal flow… Read More
Nested try block – In this article, we are going to learn nested try-catch block and multiple catch block. Nested try block is a block… Read More
Annotations are a feature of Kotlin that allows the programmer to embed supplemental information into the source file. This information, however, does not changes the… Read More
In Kotlin, visibility modifiers are used to control the visibility of a class, its members (properties, functions, and nested classes), and its constructors. The following… Read More
Kotlin gives the programmer the ability to add more functionality to the existing classes, without inheriting them. This is achieved through a feature known as… Read More
Kotlin supports inheritance, which allows you to define a new class based on an existing class. The existing class is known as the superclass or… Read More
In Kotlin, an abstract class is a class that cannot be instantiated and is meant to be subclassed. An abstract class may contain both abstract… Read More
Nested Class In Kotlin, you can define a class inside another class, which is known as a nested class. Nested classes have access to the… Read More
A constructor is a special member function that is invoked when an object of the class is created primarily to initialize variables or properties. A… Read More