Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Object Oriented Programming Interview Questions With Correct Answers.

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
15-01-2025
Written in
2024/2025

ented Programming Interview Questions With Correct Answers. What is OOPS? - AnswerOOPS is abbreviated as Object Oriented Programming system in which programs are considered as a collection of objects. Each object is nothing but an instance of a class. Write basic concepts of OOPS? - AnswerAbstraction. Encapsulation. Inheritance. Polymorphism. What is a class? - AnswerA class is simply a representation of a type of object. It is the blueprint/ plan/ template that describes the details of an object. What is an object? - AnswerAn object is an instance of a class. It has its own state, behavior, and identity. What is Encapsulation? - AnswerEncapsulation is an attribute of an object, and it contains all data which is hidden. That hidden data can be restricted to the members of that class. Levels are Public, Protected, Private, Internal and Protected Internal. What is Polymorphism? - AnswerPolymorphism is nothing but assigning behavior or value in a subclass to something that was already declared in the main class. Simply, polymorphism takes more than one form. What is Inheritance? - AnswerInheritance is a concept where one class shares the structure and behavior defined in another class. If inheritance applied on one class is called Single Inheritance, and if it depends on multiple classes, then it is called multiple Inheritance. What are manipulators? - AnswerManipulators are the functions which can be used in conjunction with the insertion () and extraction () operators on an object. Examples are endl and setw. ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED. 2 | P a g e Define a constructor? - AnswerA constructor is a method used to initialize the state of an object, and it gets invoked at the time of object creation. Rules for constructor are: -Constructor Name should be same as class name. -A constructor must have no return type. Define Destructor? - AnswerA destructor is a method which is automatically called when the object is made of scope or destroyed. Destructor name is also same as class name but with the tilde symbol before the name. What is an Inline function? - AnswerAn inline function is a technique used by the compilers and instructs to insert complete body of the function wherever that function is used in the program source code. What is a virtual function? - AnswerA virtual function is a member function of a class, and its functionality can be overridden in its derived class. This function can be implemented by using a keyword called virtual, and it can be given during function declaration. A virtual function can A token in C++, and it can be achieved in C Language by using function pointers or pointers to function. What is a friend function? - AnswerA friend function is a friend of a class that is allowed to access to Public, private or protected data in that same class. If the function is defined outside the class cannot access such information. Friend can be declared anywhere in the class declaration, and it cannot be affected by access control keywords like private, public or protected. What is function overloading? - AnswerFunction overloading an as a normal function, but it can perform different tasks. It allows the creation of several methods with the same name which differ from each other by the type of

Show more Read less
Institution
Object Oriented Programming
Course
Object Oriented Programming

Content preview

©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.




Object Oriented Programming Interview
Questions With Correct Answers.


What is OOPS? - Answer✔OOPS is abbreviated as Object Oriented Programming system in
which programs are considered as a collection of objects. Each object is nothing but an instance
of a class.

Write basic concepts of OOPS? - Answer✔Abstraction.
Encapsulation.
Inheritance.
Polymorphism.

What is a class? - Answer✔A class is simply a representation of a type of object. It is the
blueprint/ plan/ template that describes the details of an object.

What is an object? - Answer✔An object is an instance of a class. It has its own state, behavior,
and identity.

What is Encapsulation? - Answer✔Encapsulation is an attribute of an object, and it contains all
data which is hidden. That hidden data can be restricted to the members of that class.


Levels are Public, Protected, Private, Internal and Protected Internal.

What is Polymorphism? - Answer✔Polymorphism is nothing but assigning behavior or value in
a subclass to something that was already declared in the main class. Simply, polymorphism takes
more than one form.

What is Inheritance? - Answer✔Inheritance is a concept where one class shares the structure and
behavior defined in another class. If inheritance applied on one class is called Single Inheritance,
and if it depends on multiple classes, then it is called multiple Inheritance.

What are manipulators? - Answer✔Manipulators are the functions which can be used in
conjunction with the insertion (<<) and extraction (>>) operators on an object. Examples are endl
and setw.


1|Page

, ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.

Define a constructor? - Answer✔A constructor is a method used to initialize the state of an
object, and it gets invoked at the time of object creation. Rules for constructor are:


-Constructor Name should be same as class name.
-A constructor must have no return type.

Define Destructor? - Answer✔A destructor is a method which is automatically called when the
object is made of scope or destroyed. Destructor name is also same as class name but with the
tilde symbol before the name.

What is an Inline function? - Answer✔An inline function is a technique used by the compilers
and instructs to insert complete body of the function wherever that function is used in the
program source code.

What is a virtual function? - Answer✔A virtual function is a member function of a class, and its
functionality can be overridden in its derived class. This function can be implemented by using a
keyword called virtual, and it can be given during function declaration.


A virtual function can A token in C++, and it can be achieved in C Language by using function
pointers or pointers to function.

What is a friend function? - Answer✔A friend function is a friend of a class that is allowed to
access to Public, private or protected data in that same class. If the function is defined outside the
class cannot access such information.


Friend can be declared anywhere in the class declaration, and it cannot be affected by access
control keywords like private, public or protected.

What is function overloading? - Answer✔Function overloading an as a normal function, but it
can perform different tasks. It allows the creation of several methods with the same name which
differ from each other by the type of input and output of the function.


Example
void add(int& a, int& b);
void add(double& a, double& b);
void add(struct bob& a, struct bob& b);



2|Page

Written for

Institution
Object Oriented Programming
Course
Object Oriented Programming

Document information

Uploaded on
January 15, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Brightstars Havard School
View profile
Follow You need to be logged in order to follow users or courses
Sold
248
Member since
1 year
Number of followers
7
Documents
13552
Last sold
1 day ago
VERIFIED EXAMS AND STUDY GUIDES.

Here, you will find Study Notes, Exam answer packs 100% Guarenteed success.

3.2

36 reviews

5
11
4
5
3
8
2
4
1
8

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions