JavaScript > Object Oriented Programming

JavaScript > Object Oriented Programming


From this section we shall learn about the Object-Oriented Programming in JavaScript.

Object-Oriented Programming

Object-Oriented Programming is a programming language.

The main features of Object-Oriented programming style are as follows,

  • Object
  • Class
  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism

Object

An entity which has state, shape, behaviour, etc. are known as 'Object'.

NOTE: Most of the objects are nouns.

Examples: Computer, machine, TV, Pen, Watch, Rice, etc..

"Ramu went to buy a green pen"

In the above sentence Ramu & Pen (Noun's) are the objects, went & buy (Verb), black (Adjective) 

Class

Collection of objects is known as 'Class'.

Encaplsulation

Binding code and data together into a single unit is known as 'Encaplsulation'.

Example: Chewing gum is wrapped with different tasty gel's inside.

Abstraction

Abstraction is nothing but hiding the internal details and showing the functionality.

Exapmle: Websites, internal code is hided and we can see the only output of the code.

Inheritance

Inheritance is nothing but acquring all the properties and behaviours of the parent object.

Example: Real life-object like humans, animals, birds, etc.

Polymorphism

Performing one task in different ways is known as 'Polymorphism'.

Example: Drawing, Playing Games, Riding bike, etc..

To know more about Object-Oriented Programming, click here.

 

 

Read posts under JavaScript > Object Oriented Programming

4 posts found
  1. Object
  2. Encapsulation
  3. Inheritance
  4. Object Prototypes



Write for us






Hosting Recommendations