‫Welcome back.
‫We created our class, our blueprint for the robot.
‫And this class has properties like name and methods like walk and speak.
‫We can create robots with different names and using this class make them to do things like walking and
‫speaking.
‫Now let's learn about objects and how to create our robot object.
‫Scroll up and inside the main I'll create Val robot number one.
‫You can specify its type as robot and check that it is from the same package.
‫Com dot master coding dot Kotlin basics equals to robot.
‫And here I need to specify the name of the robot.
‫I'll name my robot as body.
‫This line creates a robot object named robot one.
‫Using the robot class.
‫It initializes the robot with the name body, and we can access the functions of the robot class.
‫And to do this, we use the object name robot one dot, and you can see I can access the name walk and
‫speak functionalities.
‫I'll call walk method for now.
‫If I run the program, it prints the message the robot is walking now.
‫So here I'm calling this function from our robot class.
‫If I need to call the second function, I need to specify the same way the object reference dot speak.
‫And here I need to pass an argument which is the message.
‫This line calls the speak function on robot one, allowing you to display a message from the robot with
‫the message that it is passed.
‫Here, let me run and you can see the name of the robot says hello my friend, which is the message
‫that it is passed when calling the speak function.
‫By creating objects from robot class and using its methods, you can control and interact with different
‫robots, each with its own unique properties and abilities.
‫For example, I can create another variable robot two.
‫It's of type robot I.
‫Also you can omit this because Kotlin will detect automatically that it's of type robot.
‫Here I need to specify the name of the robot.
‫I name it as Max robot two dot walk.
‫Robot two dot speak.
‫Let me run.
‫And here we go.
‫We have two robots.
‫The robot is walking.
‫The Max says hello from robot two.
‫So here in this example, we created two objects of robot class and uses their properties and methods.