Author name: Admin

Kotlin Map Interface

Before we switch what Kotlin has to offer us in terms of Map Interface. Let us first recap the Map Interface with the java. The map interface is present in java.util package which presents a mapping between the Key, Value.

Kotlin Program to Add Two Numbers

The most common program when we start learning any language after Hello World Program is to add two numbers. From as easy it may sound to making it modular and complex even to the extent adding 2 numbers without using the “+” operator. Below are the examples to add 2 numbers in different ways:

Kotlin forEach Loop

Before we jump on for each that is our topic let’s first discuss the for each loop in java. For each loop in Java would like to be: class For_Each { public static void main(String[] arg) { { int[] marks = { 12, 32, 97, 126, 130 }; int highest_marks = maximum(marks); System.out.println(“The highest score …

Kotlin forEach Loop Read More »

Will Kotlin Replace Python for Data Science?

With the trends rising forever and with Kotlin Replacing Scala to be the Second Most Used Language on JVM. There’s a lot of scope which this language have on us and for years to come. With Data Science and Machine Learning being Buzz word in the industry the next obvious question will be?

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:

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.

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 …

Kotlin String 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.

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.

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.