Properties

Question 1
Which one of the following CAN NOT be a friend
A
function
B
class
C
object
D
operator function
Question 1 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 2
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 2 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 3
How many objects can be created in a single class?
A
1
B
2
C
3
D
as many as required
Question 3 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 4

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 5

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 5 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 6

Run-time polymorphism is achieved by

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

The operator that cannot be overloaded is

A
++
B
::
C
0
D
~
Question 7 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 8

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 9
Method overriding can be prevented by using final as a modifier at ______.
A
The start of the class.
B
The start of method declaration.
C
The start of derived class.
D
The start of the method declaration in the derived class.
Question 9 Explanation: 
Method overriding can be prevented by using final as a modifier at the start of method declaration.
Question 10

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 10 Explanation: 
C++ supports multiple inheritance.
C++ supports operator overloading.
C++ supports static polymorphism.
C++ supports interface definitions.
Question 11
Friend functions have access to
A
Private and protected members
B
Public members only
C
Private members only
D
None
Question 11 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 12
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 12 Explanation: 
An ADT does not specify how the data type is implemented.
Question 13
___________ 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 13 Explanation: 
Process class is a class which implement lower level business abstractions required to manage the business domain class.
Question 14
A subclass having more than one super class is called __________ .
A
Category
B
Classification
C
Combination
D
Partial participation
Question 14 Explanation: 
A subclass having more than one super class is called category.
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
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 16 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 17
In a object oriented software design, ‘Inheritance’ is a kind of __________ .
A
relationship
B
module
C
testing
D
optimization
Question 17 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 18
The data hiding is taken care by :
A
Abstraction
B
Encapsulation
C
Modularity
D
Inheritance
Question 18 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.
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