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.
ReadThis 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 :.
ReadIn 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 :.
ReadFor 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 :.
ReadThis 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.
ReadIn 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 :.
ReadThe 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.
ReadKotlin 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 :.
ReadSimilar 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