• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 7 páginas
Examen

Object Oriented Programming Interview Questions With Correct Answers.

Document preview thumbnail
Vista previa 2 fuera de 7 páginas

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

Vista previa del contenido

©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

Información del documento

Subido en
15 de enero de 2025
Número de páginas
7
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$10.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Brightstars
3.4
(42)
Vendido
276
Seguidores
7
Artículos
15806
Última venta
2 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes