Introduction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Kotlin has some excellent features that offer significant benefits. One of these features is the data type declaration.

When compilers know the data type they’re working with, they can optimize computations. Knowing the data type also helps them better manage memory usage during execution.

Still, specifying every detail can make the program cumbersome, even for small tasks. Kotlin helps in avoiding unnecessary details.

Note: Compilers are programs that convert your code into a language the computer understands.

This lesson demonstrates how Kotlin helps you write concise and clean code that accomplishes a lot. You’ll learn how Kotlin intelligently assigns types to variables so you don’t have to.

While you have the option to add types, you’ll realize that it’s often unnecessary. Unlike some programming languages, specifying a type when declaring a variable is optional in Kotlin. There are valid reasons for declaring or inferring types, and you’ll learn about them in this lesson.

Strings are used everywhere in software development. You’ll use them often in this course to display information while learning Kotlin. In this lesson, you’ll discover various ways to manipulate strings to achieve your desired output.

By the end of this lesson, you’ll learn:

  • The difference between declared and inferred types.
  • How to define a variable’s type.
  • How to perform String interpolation.
See forum comments
Download course materials from Github
Previous: Learn the Kotlin Language: Create Variables Next: Instruction 1