kotlin

kotlin

What is primary constructor and secondary constructor in Kotlin

As we know that a constructor is used to construct a class object. In Kotlin, constructors are categorized into two types - primary and secondary. A Kotlin class can have only one primary constructor and multiple secondary constructors. In this tutorial post, we will learn about these constructs and their use cases.

Read
kotlin

Kotlin program to check if an alphabet is vowel or not

This is a simple Kotlin example to show you how when and if-else condition works in Kotlin. Problem is to find out if an alphabet is vowel or consonent.Our program will print out the result in one statement i.e. if the character is alphabet or vowel. Let's take a look :.

Read
kotlin

Kotlin program to calculate the total number of digits in a number

In this Kotlin programming tutorial, we will learn how to calculate the total number of digits in a number. For example, 1245 has four digits. This example is mainly for Kotlin beginners. If you have started learning Kotlin after Java, we have also included the Java version of the same problem. It will show you :.

Read
kotlin

How to run a Kotlin program using command line

For running a Kotlin program, what IDE you use ? IntellijIdea,Eclipse Visual Studio Code or anything else ? We can also run a Kotlin program using command line. If you love working with command line, you can use Kotlin compiler to compile and run a program directly. In this tutorial, we will learn how to do this. Let's take a look :.

Read
kotlin

Kotlin program to change uppercase and lowercase of a string

This is a simple Kotlin sample program that will show you how to check if a character is lowercase or uppercase and how to convert it to a lowercase or uppercase character.

Read
kotlin

Kotlin tutorial : Character in kotlin and functions of Character class

In Kotlin, we use "Char" to represent a character. Also, we can create one character variable by using one single quote pair. For example, for the following program :.

Read
kotlin

Kotlin development tutorial - Array in Kotlin

The arrays in Kotlin is defined by the Array class. This tutorial will show you how to create an array and how to access array elements in Kotlin with examples.

Read
kotlin

Kotlin tutorial for beginner : Introduction and setup

Kotlin was developed by JetBrains, the company behind different popular products like IntelliJ IDEA, PyCharm, RubyMine etc. They have started it in July 2011, but the first official stable release was on Feb 15, 2016(Kotlin V1.0). Kotlin is an [opensource](https://github.com/JetBrains/kotlin) project under Apache 2 license. On Google IO 2017, Google has announced full Kotlin support for Android development and starting Android Studio 3.0, kotlin is included in the Android Studio by default. You can even run kotlin code along with Java code. This is our first post on kotlin. In this tutorial, we will learn the basics of Kotlin language, how to setup and how to run a simple program. Let's take a look :.

Read
kotlin

Kotlin tutorial : String in Kotlin with examples

Similar to Java, strings are a series of characters in Kotlin. String type is used for string variables. We can create one string variable similar to other. For example :.

Read