Key Concepts

Review core concepts you need to learn to master this subject

Mutable Variables

var age = 25 age = 26

A mutable variable is declared with the var keyword and represents a value that is expected to change throughout a program.

Data Types & Variables
Lesson 1 of 3
  1. 1
    In this lesson, we’ll explore the building blocks of a programming language - data types and variables. A data type represents the type of value an object possesses. Here are a few of the types o…
  2. 2
    Now that we’ve familiarized ourselves with the concept of variables, let’s learn how to create a variable in Kotlin. A complete variable declaration and initialization resembles the following form:…
  3. 3
    Another type of variable that exists in Kotlin is the immutable variable. The term, immutable, signifies a variable whose value cannot mutate or change after its initialization. _Immutable variab…
  4. 4
    In Kotlin, we can save keystrokes and optimize our variable declarations with a feature known as type inference. Type inference indicates that the compiler can infer the type of a declared vari…
  5. 5
    Excellent job! You’ve completed the first lesson of the Data Types & Variables section. Let’s review what was covered. - A variable declaration consists of a val or var keyword followed by a name…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo