Get Started with Kotlin on Android

Updated 6 November 2017

Save

In this blog, we’re going to take a look at Kotlin, a new language in the JVM world, and some of its basic features, including classes, inheritance, conditional statements, and looping constructs.

Defining function in kotlin

Defining variables

Using when expression it’s more like switch case.

Using a for loop

Constructors

A class in Kotlin can have a primary constructor and one or more secondary constructors. The primary constructor is part of the class header  it goes after the class name (and optional type parameters).

Have you notice there no semicolon in sentences in Kotlin you don’t have to put the semicolon at the end of sentences. Null-safety is an important feature of the Kotlin language. It helps developers avoid NullPointerExceptions and improves the quality of their apps.

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home