Concept of Object, OOP, terms and terminologies



Object means all the things around us like book, pen, car, table, human, animals etc. Object what actually represents, self contained entity that has attributes and behavior. lets, talk about human. A person is self contained entity because they have attributes and behavior. A person has attributes like weight, height, color, hair etc. and also behavior like they can walk , they can talk, laugh and so on. Entity contains the data that represents the attribute and behavior which actually refers the task that Object can perform. In Object Oriented Programming (OOP), software is the collection of Objects that interacts with each other to get the desire task done. According to traditional view, programs calls the set of predefined procedures. To understand what Object Oriented is, let's assume example in real world. 


Suppose you got a call from your office, now you are in home. You should show your documents to your boss. What you do is you be ready and start the car and reach to the office. Here, Car is an object as it is self contained. It has its own attributes, like design, color, and so on. And how you reach to office is method. At first you start the car, kick on clutch, shift to gear and press accelerator. By using several method you reach to the destination. Again, let's talk about bank account, each bank account can be viewed as object. It has its type, owner, balance etc. I think now you are cleared.

Now, lets talk about terms and terminologies. There are many terms and terminologies related to Object Oriented Programming. Some are described below:-

Class:- Class is simply defined as the template or blueprint. From class, object is created. All the attributes and methods of object are defined in class. The car will share same traits. For example, class car will define its attributes and behavior, here car is an object which can be any type of car.

Object:- Object is instance of classes created at runtime. The object Ford Mustang(car) is one particular car with particular characteristics instantiated from the class car.

Method:- It is the task that object can perform. Car has ability to start, run, stop and so on. First of all, we should start the engine. To start the engine, key is used and necessary also. Here, key is an external argument of method, which clarifies that external data should be passed to execute method. To start engine, key should be used.

Message passing:- Message passing is the process of passing the message from one object to another object. In this process one object ask to another object to invoke the method. For example, Mathew (object) may start the engine of car(object) by invoking the method(start_engine) using external argument(key). To execute the task, he should use the correct key. And finally, the key is the data that must be passed from Mathew(object) to car(object).

Interface:- It is the point from where a class interacts with outside world. When a class implements the interface, it promise to provide the behavior published by that interface.

Inheritance:- The attributes and methods of super class is inherited. The class which inherits the attributes and methods of super class is known as sub-class.

Polymorphism:- Polymorphism is a generic term that means "many shapes". It refers to the ability of same method in different sub-classes that are derived from same class to behave differently.

Encapsulation:- It conceals the functional details of a class from object that send message to it.

Comments

Popular posts from this blog

Logical operator in JAVA

Class and Object in Java

Loop Structure