Kotlin Int to String

Having converted Kotlin Int to String, we will now explore the cases when we wish to convert an Int to a String. It usually happens when we wish to append an integer into a String.

The conversion from Kotlin Int to String can happen automatically when passes inside a print statement like below:

Read more

Kotlin String to Int

In modern languages, where the entire a lot of data is fetched to and from the applications. Every I/O is majorly worked in Strings. But the problems with String is their usability. I cant find the sum of two Strings until and unless you wish to view a concatenated value.

Read more

Kotlin String

String form a very important part in terms of input and output. All the input and output processing (including file I/O, Stream I/O) for kotlin as similar to Java is done in the form of Strings. Now let’s recall the Java’s main function.

public static void main(String [] args){	
	//Here, if you refer args or run time arguments are again taken in the form of Strings.

Read more

Kotlin Sealed Classes

Having gone through the concepts of classes in Kotlin, we understand that classes form the basis for any OOP’s oriented language and Kotlin is no different. As evident from the name itself, Sealed Classes are the classes which are closed or sealed, which makes their usage restricted.

Read more

Kotlin Exception Handling

In this tutorial we will discuss about Kotlin exception handling concept in detail.

Errors, Exceptions are the developer’s nightmare as well as help guide. Let’s understand the basic difference between Error and Bugs.

Anything which breaks the normal flow of control of a program can be termed as an Exception.

Read more

Kotlin Null Safety

As a developer, we always have faced NullPointerException, or commonly known as ‘The Billion Dollar Mistake’. Every introduction of kotlin talks about the kotlin’s capablity to handle Null Pointers. Yes, take it as a relief Kotlin can handle null pointers for you, thanks to its type system.

Read more

Kotlin Interface

Talking about interface, there are two types of implementations which exists, the pre Java 8 ones where interfaces could contain only abstract methods. But in the recent update of Java 8, where interfaces were allowed to have implementations of methods as well as abstract methods. Kotlin offers similar type of interfaces i.e. Interface in kotlin are allowed to have implemented methods as well as abstract methods.

Read more

Kotlin Abstract Class

A class which is declared with keyword ‘abstract’ is termed as Abstract Class, these can also be termed as classes which can’t be instantiated. Or in Simple words, we cannot create objects of Abstract classes. Similar to Java, abstract classes in Kotlin can be inherited in sub classes.

Read more

Kotlin Constructors

Having read about the kotlin classes and objects, let’s have a look at initialization of class objects. This can be done using constructors. So in simple words:

“A constructor is a special member function which is called when the object is instantiated or created.”

Read more