stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
unit-1 C++ B.com CA Additional Flashcards | StudBud
Explore
/
unit-1 C++ B.com CA Additional
unit-1 C++ B.com CA Additional
20 terms
·
StudBud Administration
·
12 plays
Imported from external platform
Flashcards
20 cards
F
Practice quiz
P
Host live
L
Questions
20
Answers
1
Which type of polymorphism is supported by method overloading?
Late binding
Compile-time polymorphism
Dynamic polymorphism
Runtime polymorphism
2
C++ is Object oriented programming language.?
False
True
3
3. Which keyword is used to declare a function as a friend in C++?
D) public
A) private
C) friend
B) protected
4
6. What does the delete operator do in C++?
B) Releases dynamically allocated memory
D) Creates an object
C) Returns a pointer to an object
A) Allocates memory dynamically
5
9. Which of the following is the correct way to overload the == operator?
A) bool operator==(const ClassName &obj);
C) int operator==(const ClassName &obj);
B) void operator==(const ClassName &obj);
D) float operator==(const ClassName &obj);
6
What is an object in C++?
An instance of a class
A pointer
A variable of type int
A template of a class
7
What are the four pillars of OOP?
Abstraction, Encapsulation, Inheritance, Polymorphism
Method Overloading, Method Overriding, Interfaces, Packages
Public, Private, Protected, Default
Class, Object, Constructor, Destructor
8
7. What is the return type of the overloaded << operator for cout?
B) ostream&
A) void
) int
D) char
9
4. Which operator is used to allocate memory dynamically in C++?
A) malloc
C) new
B) calloc
D) alloc
10
What keyword is used to define a class in C++?
struct
define
class
object
11
What is an abstract class?
A class with only static methods
A class with only abstract methods
A class that cannot be instantiated
A class that supports multiple inheritance
12
8. The operator++() when overloaded in postfix form takes how many arguments?
B) 1
C) 2
D) No fixed number
A) 0
13
Which of the following correctly defines encapsulation?
Hiding implementation details and exposing only necessary functionality
Writing multiple constructors in a class
Creating a child class from a parent class
Defining multiple methods with the same name
14
2. What is the purpose of the operator= function in C++?
B) To implement assignment operator overloading
D) To define a constructor
A) To define a custom addition operation
C) To perform type casting
15
10. Which operator is used to access the address of a variable?
C) ->
D) sizeof
A) *
B) &
16
Which OOP principle allows data hiding?
Abstraction
Inheritance
Encapsulation
Polymorphism
17
Which of the following concepts means “one name, multiple forms”?
Encapsulation
Polymorphism
Abstraction
Inheritance
18
1. Which of the following operators cannot be overloaded in C++?
B).
A)+
C)*
D)-
19
5. Which of the following operators can be overloaded?
D) typeid
B) ::
A) sizeof
C) *
20
What is the main purpose of inheritance?
To hide implementation details
To restrict access to class members
To enable a class to acquire the properties of another class
To achieve dynamic method dispatch