0% found this document useful (0 votes)
24 views3 pages

Guesss

Guess means a lot of people who are you ready for some reason I love you all

Uploaded by

storefn058
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Guesss

Guess means a lot of people who are you ready for some reason I love you all

Uploaded by

storefn058
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1. Which access specifier allows access to members from any part of the program?

a) Public b) Protected c) Private d) Non


2. What is inheritance in OOP?
a) Creating a new class from an existing class b) Creating a new object from an existing object
c) Creating a new function from an existing function
d) Creating a new variable from an existing variable
3. What is polymorphism in OOP?
a) Ability of an object to take multiple forms b) Ability of a function to perform multiple tasks
c) Ability of a class to inherit from multiple classes d) Ability of an object to access multiple
class
4. Can a class have multiple constructors in C++?
a) No b) Yes c) Only for derived classes d) Only for base classes
5. What is the purpose of the "virtual" keyword in C++?
a) To override a function b) To overload a function
c) To create a pure virtual function d) To create a friend function
6. What is abstraction in OOP?
a) Hiding implementation details b) Showing implementation details
c) Inheriting implementation details d) Polymorphic implementation details
7. What is the difference between "static" and "dynamic" binding?
a) Static binding is used for polymorphism; dynamic binding is used for inheritance
b) Static binding occurs at runtime; dynamic binding occurs at compile-time
c) Static binding is used for inheritance; dynamic binding is used for polymorphism
d) Static binding occurs at compile-time; dynamic binding occurs at runtime
8. Can a class have multiple base classes in C++?
a) Yes b) No
9. What is the purpose of a constructor in C++?
a) To deallocate memory b) To destroy objects c) To allocate memory d) To initialize
objects
10. When is a destructor called in C++?
a) When an object is created b) When an object goes out of scope
c) When an object is explicitly deleted d) When the program terminates
11. The user define data type “class” has by default access specifier ___________to all members.
(a) private (b) protected (c) public (d) none of them
12. The data item that is contained within an object is called:______________________.
(a)Instance (b) Attribute (c) Class (d) Method
13. Member of a class are accessed with the: _____________________
(a) Dot operator (b) extraction operator (c) insertion operator (d) none of them
14. A member function that is automatically called, when object of the class is destroyed is
called _____.
(a) constructor (b) destructor (c) object (d) none of these
15. in which of the class member can only be used by its own public methods and
friends____________.
(a) public (b) protected (c) private (d) final
16. The member of class with protected access specifier can be accessed________________.
(a) Derived class (b) Inside the class (c) outside the class (d) both a&b
17. The ability of a class to derived properties from a preiously define class is: ___________.
(a)Polymorphism (b) Operator Overloading (c) Inheritance (d) Encapsulation
18. Another name for the base class is:__________________.
(a) Base class (b) ancestor class (c)Super class (d) all of them
19. Dynamic binding in C++ occurs at: ______________________.
(a) Compile time (b) Link time (c) runtime (d)none
20. A ____________ of a base class expects to be overridden in a derived class.
(a) Constructor function (b)Virtual Function (c) destructor function(d) none.
21. How many classes can be defined in a single program?
a) 1 b) 10 c) 100 d) as many as you want
22. What is default access specifier for data members declared within a class without any
specifier, in C++?
a) Private b) Protected c) Public d) Depends on compiler
23. ____ is a process of providing only the essential details and hiding the internal details.
a) inheritance b) Polymorphism c) data abstraction d) None
24. How many objects can be declared of a specific class in a single program?
a) 1 b) 2 c) 3 d) as many as you want
25. How members of an object are accessed?
a) Using dot operator b) Using scope resolution operator
c) Using member names directly d) Using pointer only

26. If same message is passed to objects of several different classes and all of those can
Respond in a different way, what is this feature called?
a) Inheritance b) overloading c) overriding d) Polymorphism

27. Which type of function among the following shows polymorphism?


a) inline function b) virtual function c) Undefined function d) None
28. What is a binary operator?
a) Operator that performs its action on a single operand
b) Operator that performs its action on two operand
c) Operator that performs its action on three operand
d) Operator that performs its action on any number of operands
29. Which feature in OOP is used to allocate additional function to a predefined operator?
a) Operator overloading b) operator overriding
c) Function overloading d) function overriding
30. A base class is also known as _______ class.

a) Basic b) inherited c) super d) Sub


Q: What is access specifier? Briefly discuss public, protected and private access specifier with
example.

Q: Comment on the following:

a) Constructor b) Destructor c) Function Overloading


Q: Define Operator overloading. Write a program to overload” ++ “operator.

Q: Write short note on any two of the following:


a) Inheritance
b) Polymorphism
Abstraction
Q: a) Describe the difference between inheritance and composition in OOP.

b) Write a program to demonstrate inheritance using a base class "Vehicle" and derived
classes "Car" and "Truck".

Q: a) Compare overloading and overriding in OOP.

b) Write a program to demonstrate polymorphism using function overriding.

Q: a) What is the purpose of the "virtual" keyword in OOP?

b) Compare static and dynamic binding in OOP.


Q: Define class and object in C++ .What is access specifier in Class? explain with the help
of example.
Q: What is Polymorphism? Explain Virtual function. Also differentiate between early
binding and late binding with the help of example.
Q: What is inheritance, explain with example? Explain function overloading and function
overriding with example.

You might also like