Kotlin Fundamentals in Examples
Published in
6 min readMar 24, 2021
In this article we will take a look at the fundamental features of a Kotlin language “A modern programming languagethat makes developers happier”.
What will be covered in this article:
- No “public static void main”
- Creating an instance
- High-order functions and lambdas
- If-else
- Null safety
- No switch statement/When expression
- Try/catch/finally
- Ranges
No “public static void main”
Let’s begin our journey to Kotlin by creating a simple example of a required function in Java (the entry point of Java’s applications):
public static void main(...){}
How it looks in Java:
Hot it looks in Kotlin