Properties

Question 1
___________ is a class which implement lower level business abstractions required to manage the business domain class :
A
User interface class
B
System class
C
Business domain class
D
Process class
Question 1 Explanation: 
Process class is a class which implement lower level business abstractions required to manage the business domain class.
Question 2
Which of the following is not specified in Abstract data type?
A
Type
B
Set of operations on that type
C
How the type is implemented
D
(A) and (B)
Question 2 Explanation: 
An ADT does not specify how the data type is implemented.
Question 3
Friend functions have access to
A
Private and protected members
B
Public members only
C
Private members only
D
None
Question 3 Explanation: 
A friend function of a class is defined outside that class' scope but it has the right to access all private and protected members of the class.
Question 4
Which among the following is the correct way of declaring object of a class
A
Classname objectname;
B
Class classname obj objectname;
C
Class classname obj objectname;
D
Classname obj objectname
Question 4 Explanation: 
The correct way of declaring object of a class is Classname objectname;
For example ,let there be some class of name Area. So we can declare object of Area class like,
Area A1;
Question 5
How many objects can be created in a single class?
A
1
B
2
C
3
D
as many as required
Question 5 Explanation: 
An object is nothing but an instance of a class. A class can have as many instances as required. There is no restriction on the number of objects a class can have.
Question 6
Which one of the following CAN NOT be a friend
A
function
B
class
C
object
D
operator function
Question 6 Explanation: 
The function is not in the scope of the class to which it has been declared as a friend. It cannot be called using the object as it is not in the scope of that class. It can be invoked like a normal function without using the object.
Question 7

Which of the following statements are true regarding C++?

(a) Overloading gives the capacity to an existing operator to operate on other data types.

(b) Inheritance in object oriented programming provides support to reusability.

(c) When object of a derived class is defined, first the constructor of derived class in executed then constructor of a base class is executed.

(d) Overloading is a type of polymorphism.
Choose the correct option from those given below:
A
(a) and (b) only
B
(a), (b) and (c) only
C
(a), (b) and (d) only
D
(b), (c) and (d) only
Question 7 Explanation: 
TRUE: Overloading gives the capacity to an existing operator to operate on other data types.
TRUE: Inheritance in object oriented programming provides support to reusability.
FALSE: When object of a derived class is defined, first the constructor of derived class in executed then constructor of a base class is executed.
2 important points Order of Constructor Call with Inheritance in C++
1. Whether derived class's default constructor is called or parameterised is called, base class's default constructor is always called inside them.
2. To call base class's parameterised constructor inside derived class's parameterised constructor, we must mention it explicitly while declaring derived class's parameterized constructor.
TRUE: Overloading is a type of polymorphism.
Question 8

If a class C is derived from class B which is derived from class A, all though public inheritance, then a class C member function can access

A
protected and public data in C and B
B
protected and public data only C
C
private data in A and B
D
protected data in A and B
Question 9

Function overloading in C++ is

A
A group function with the same name
B
all have the same numbers and type of arguments
C
functions with same name and same numbers and same type of arguments
D
None of the given options
Question 9 Explanation: 
Function Overloading is defined as the process of having two or more function with the same name, but different in parameters is known as function overloading in C++. In function overloading, the function is redefined by using either different types of arguments or a different number of arguments.
Question 10

Run-time polymorphism is achieved by

A
friend function
B
virtual function
C
operator overloading
D
function overloading
Question 10 Explanation: 
Run-time polymorphism is achieved by function overriding.
Question 11

The operator that cannot be overloaded is

A
++
B
::
C
0
D
~
Question 11 Explanation: 
There are 4 operators that cannot be overloaded in C++. They are :: (scope resolution), . (member selection), . * (member selection through pointer to function) and ?: (ternary operator).
Question 12

The keyword friend does not appear in

A
the class allowing access to another class
B
the class desiring access to another class
C
the private section of a class
D
the public section of a class
Question 13

Which of the following statements is true about C++ language?

A
C++ supports multiple inheritance
B
C++ does not support operator overloading.
C
C++ supports dynamic polymorphism
D
C++ supports interface definitions.
E
Both A and D
Question 13 Explanation: 
C++ supports multiple inheritance.
C++ supports operator overloading.
C++ supports static polymorphism.
C++ supports interface definitions.
Question 14
Which of the following operators cannot be overloaded in C/C++ ?
A
Bitwise right shift assignment
B
Address of
C
Indirection
D
Structure reference
Question 14 Explanation: 
→ We can’t overload structure reference in C and C++.
→ Bitwise right shift assignment(>>), Address of(&) and Indirection(*) can be overloaded in C and C++.
→ The . (dot) operator and the → (arrow) operator are used to reference individual members of classes, structures, and unions.
Question 15
Which one of the following is correct for overloaded functions in C++ ?
A
Compiler sets up a separate function for every definition of function.
B
Compiler does not set up a separate function for every definition of function.
C
Overloaded functions cannot handle different types of objects.
D
Overloaded functions cannot have same number of arguments.
Question 15 Explanation: 
→ Function overloading allows you to use the same name for different functions, to perform, either same or different functions in the same class.
→ Compiler sets up a separate function for every definition of function.
→ Two ways to use overloaded function is
1. By changing number of Arguments.
2. By having different types of argument.
Question 16
In a object oriented software design, ‘Inheritance’ is a kind of __________ .
A
relationship
B
module
C
testing
D
optimization
Question 16 Explanation: 
→ Inheritance refers to a particular relationship that two or more classes can share.
→ Polymorphism refers to a particular feature of classes that define an inheritance relationship.
Question 17
The data hiding is taken care by :
A
Abstraction
B
Encapsulation
C
Modularity
D
Inheritance
Question 17 Explanation: 
→ Abstraction is used for hiding the unwanted/important data and giving relevant data. → It only focus on what the object does instead of how it does it.
Question 18
If a data-item is declared as a protected access specifier then it can be accessed :
A
Anywhere in the program
B
By the base and derived classes
C
Only by base class
D
Only by derived class
Question 18 Explanation: 
If a data item is declared as a protected access specifier then it can be accessed by the base and derived classes.
There are 18 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access