‫Welcome back.
‫In this video we'll learn about classes in Kotlin.
‫A class is a blueprint that defines the properties and behaviors of objects.
‫It encapsulates data and functions that operate on the data.
‫So a class is a blueprint for creating your objects.
‫In this example, we have a blueprint, a class of a tank, and you can create as many tanks as you
‫want.
‫Once you have this blueprint, all the tanks have the same properties and can do the same things.
‫Let's jump into Android Studio and create our first class.
‫You can define classes in the project by creating a new Kotlin class or file and select a class.
‫Or you can define classes here in the same file that I'm working with.
‫I'll create a class called robot, and this class needs a name for this robot.
‫I'll specify it in the constructor.
‫Later on we'll learn about constructors, but for now just follow me.
‫In this class I'll define two functions.
‫One is named as walk and the second is speak.
‫The first method has no parameters, just telling us that this robot is walking.
‫The second method speak takes into the parameter a string variable.
‫Print a message set by this robot.
‫I'll use this property name says and the message parameter of this function.
‫This is how we create classes in Kotlin.