Chapter 7. Kotlin Variables, Operators, and Expressions
In this chapter and the next, we are going to learn and practice the core fundamentals of Kotlin. In fact, we will explore the main principles of programming in general. In this chapter, we will focus on the creation and understanding of data itself, and in the next chapter, we will explore how to manipulate and respond to it.
This chapter will focus on the simplest type of data in Kotlin – variables. We will revisit more complex and powerful types of data in Chapter 15, Handling Data and Generating Random Numbers.
The core Kotlin fundamentals that we'll learn about apply when working within classes that we inherit from (such as Activity
and AppCompatActivity
) and the classes that we write ourselves (as we will start to do in Chapter 10,
Object-Oriented Programming).
As it is more logical to learn the basics before we write our own classes, we will learn the basics and then use the extended Activity
class, AppCompatActivity...