1 |
Which one of the following is not an object association? |
Simple Assocation
Inheritance
Aggregation
Composition
|
2 |
We achieve independence of internal implementation from its external interface through----------- |
Encapsulation
Information Hiding
Abstraction
both encapsulation and information hiding
|
3 |
Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work
correctly, if the overloaded - operator must |
take two arguments
return a value
create a named temporary object.
take four arguments
|
4 |
Suppose that the Test class does not have an overloaded assignment operator. What happens when an
assignment a=b; is given for two Test objects a and b? |
The automatic assignment operator is used
The copy constructor is used
Compiler error
Run-time error
|
5 |
Friend class and friend function can be used as an alternate to each other |
True
False
Not Sure
|
6 |
Given the following class
class Base{
int Age=33;
}
How you can improve above class with respect to accessing the field Age? |
Define the variable Age as private
Define the variable Age as protected
Define the variable Age as private and create a get method that returns it and a set method that
updates it
Define the variable Age as protected and create a set method that returns it and a get method that updates it
|
7 |
C++ compiler does not allow to dynamically allocate memory for object |
False
True
Not sure
|
8 |
his pointers are not accessible for static member functions. |
True
False
Not Sure
|
9 |
________ is/are used to access information hidden within an object? |
Interface
Private data members
Private member functions
Both public and private members
|
10 |
What a derived class can add? |
New data members
New member functions and New friend functions
New constructors and destructor
All of given
|