What is an object?

An instance of the class is called an object the object can be defined as a concept, abstraction, or thing with crisp boundaries and meaning.

All objects have a distinguishable identity. The term identifies meaning objects are distinguished by their interrupt, existence and not by descriptive properties that they may have

for example: Facebook, parrot, and dove are objects that have similar characteristics.

So we can say the above instances are within in bird class. In object-oriented methodology, each constitutes with function. The function of an object has the sole, authority to operate on the private data of the corresponding object.

Therefore an object can not directly access the data internal to another object to manipulate the internal data of an object it is essential to use its function.

In the above statement, the student is the class, and x, y is the object name. According to OOP[Object Oriented Program] concept X, the display function is different from the y display function.

Advantages of encapsulation:

  1. It protects an object’s number of variables from correction by the other object.
  2. Protection is provided against unauthorized from the outside of the object.
  3. It hides the internal structure of an object.
  4. Since object communicates with each other using messages they are weakly coupled.

Write a short note on polymorphism.

Ploymorephysim is a technique or concept ability to make more than form of something. Suppose an operation or method exhibits different behaviour in different situations then it can be called that the method has become polymorphism.

ex:

class student

{

int roll;

char name[15];

void display()

{

court<<“Roll= “<<roll<<“\n Name=”<<name;

}

};

student x,y;

In the above statement, the student is the class, and, x, y is the object name. According to OPP [Object oriented Programming] concept x, the display function is different from the y.display function.

What is class?

A group of similar objects constitute a class. This means objects programming similar attributes and displaying similar behavior constitute a class.

For example: The set of all employees can constitute a class in an employee object similar to each employee’s name, emp-code, address, etc. exhibits similar behavior as other employee objects. since each object is created as an instance of some class, classes can be considered as abstract data types[ADI].

e.g:

class student

{

char name[15];

void get data();

void put data();

};

void student::get data()

{

court<<“Enter name and roll”<<endl;

cin>>name>>roll;

}

void student::put data()

{
court<<“Roll= “<<Roll<<“\n Name= “<<name;

}

Write a short note on data abstraction.

The abstraction is a mechanism that hides the technical details of the object of object and represents the essential features to its users. The classes use the concept of data abstraction and are defined as a list of attributes such as name, roll no, markets, and function to operate these attributes. They encapsulate all the essential properties of the objects that are to be created. The attributes sometimes called data members hold information of a particular object in some instance. The functions that operate these data are called the method of members functions of those objects.

Write a short note on Encapsulation.

The property of an object by which it interfaces with the outside world is referred to as encapsulation. The data end the method of an object are encapsulated into a single unit which is called class. The data is not accessible to the outside world and only those functions which are wrapped in the class can access it.

What do you mean by Dynamic Binding?

Binding refers to the linking of a function, or call to the code to be executed for the function in response to the call. Dynamic binding means that the code associated with a given function call is not known until the time of the call at run time. It is associated with polymorphism and inheritance. A function call is associated with a polymorphism function with a different code.

Consider the function drawn for circles, rectangles, and triangles as an example. By inheritance, each object has the function of the same name drawn. At runtime, the function code matching the object under the current reference object will be called.

What do you mean by message passing?

An object-oriented program consists of a set of objects that communicate with each other the objects communicate with one another by sending and receiving information by using the message passing technique. A message for an object is a request for execution of a function. therefore will invoke a function in the receiving objects that generates the desired result the message passing involves specifying the name of the object, the name of the function, and the information. The name of the function of an object acts as a message, and the argument of a function acts as information.

Ex:

Employee salary(Name); this statement acts as a message-passing statement.

What are the advantages of OOP?

  1. Through inheritance, redundant code can be eliminated, and extend the use of existing classes.
  2. It reduces the program development time with higher productivity.
  3. The security of data and functions can be controlled by data hiding.
  4. It is possible to have multiple instances of an object co-exist without any interference.
  5. It is possible to map objects in the program domain to those in the program.
  6. The OOP can be easily upgraded.

Difference between c & c++

C(POP)C++(OOP)
This programming technique emphasizes doing algorithms.This programming technique emphasizes on the data
Large programs are divided into functions.Large programs are divided into objects.
Most of the functions share global data Functions that operate on the data of an object are tied together.
Ploymorephysim, the data-hiding concept can not be employed.Ploymorephysim data hiding concept can be employed
New data or functions are difficult to implement in previous development programs.New data or functions can be easily implemented into the previous development program.
It follows a top-down approach in program design.It follows a bottom-up approach in program design.

What do you mean by reference variable?

A reference variable provides an alternative name for a previously defined variable.

For example: It a memory space is defined by the variable “sum” this memory space can also be referenced by another name ‘total’, then the names ‘total’ and ‘sum ‘ can be used interchangeably to represent that variable.

Syntex: Data type reference name = variable name.

Leave a Comment