The new keyword and calling the object’s constructor function. For example if we have an object representing a car. In the previous example a myCar object of class The object has a brand property that contains the value Toyota and a model property that contains the value Camry. Also the object has a drive method that prints a message to the console. In addition to objects we can use Inheritance to create structures that allow objects to take advantage of
properties and methods in another class. We can define a new class based on an existing class using the extends keyword. For example Business Lead let's define a class SportsCar that is based on the class Car. In the previous example the SportsCar class was created based on the Car class using the extends keyword. The object created from class SportsCar has an additional property called topSpeed whose value we can set while creating the object. Also the SportsCar class has an additional method called race that prints a message showing the race of the car. Abstraction And Expression Of

Relationships: In object-oriented programming developers strive to achieve abstraction and express relationships between objects effectively. This is done by hiding the internal details of the object and providing a simple and understandable application programming interfaceAPI. For example let's create a Shape class that has a color property and a draw method. In this example the shape is abstracted and represented by the Shape class which has a color property and a draw method. We can create derived classes like Circle and Square that are based on the Shape class and add specific.