First of all, I want to tell you that as you know Object is the main various part of the JavaScript language. And I want to clarify that JavaScript is not similar to Java. Both are different things. JavaScript is an Object Oriented Programming (OOP) language. A programming language can be called object-oriented if it provides some basic capabilities like : −
- Class: – Class can be defined as a template or blueprint that describe the behaviors or states that object of its type support. A class can contain many objects in a single class.
- Object:- Object is an instance of a class. Object have states and behavior, for example, a dog has states like name, color as well as behavior like barking, eating etc.
- Inheritance:- Inheritance can be defined as a process where one or more object acquires the properties and functionality of another class.
- Polymorphism:- Poly means many and morphism means form. polymorphism means many forms. We can be defined as like A polymorphism is an ability to takes an object in many forms.
- Encapsulation:- Encapsulation is nothing but just a Technique where the end user doesn’t know how to implement in that class, users can have to permission what to store and what to reject and that data can be read only or write only or both. In the simplest way if I have to define Encapsulation then I can say like Encapsulation is a mechanism to wrapping the date variable and code action on the data method as a single unit.
No comments:
Post a Comment