Encapsulation Questions for Mphasis

Question 1

Time: 00:00:00
In c++ how are protected members of a base class accessed in derived class when inherited privately

Privately

Privately

Publicly

Publicly

Protectedly

Protectedly

Not Inherited

Not Inherited

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
Which of the following statements is correct when a class is inherited publicly?

Public members of the base class become protected members of derived class.

Public members of the base class become protected members of derived class.

Public members of the base class become private members of derived class.

Public members of the base class become private members of derived class.

Private members of the base class become protected members of derived class.

Private members of the base class become protected members of derived class.

Public members of the base class become public members of derived class.

Public members of the base class become public members of derived class.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
Which of the following access specifies is used in a class definition by default?

Protected

Protected

Public

Public

Private

Private

Friend

Friend

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
Which of the following can access private data members or member functions of a class?

Any function in the program.

Any function in the program.

All global functions in the program.

All global functions in the program.

Any member function of that class.

Any member function of that class.

Only public member functions of that class.

Only public member functions of that class.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Which of the following statements about virtual base classes is correct?

It is used to provide multiple inheritance.

It is used to provide multiple inheritance.

It is used to avoid multiple copies of base class in derived class.

It is used to avoid multiple copies of base class in derived class.

It is used to allow multiple copies of base class in a derived class.

It is used to allow multiple copies of base class in a derived class.

It allows private members of the base class to be inherited in the derived class.

It allows private members of the base class to be inherited in the derived class.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
State whether the following statements about inheritance are True or False.
i) A public member of a class can be accessed by its own objects using the dot operator.
ii) While inheriting, the private members of the base class will never become the members of its derived class.

True, False

True, False

False, True

False, True

True, True

True, True

False, False

False, False

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
Encapsulation is?

Binds together code and data

Binds together code and data

Using single interface for general class of actions.

Using single interface for general class of actions.

Reduce Complexity

Reduce Complexity

All above

All above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
Which of the following concepts means wrapping up of data and functions together?

Abstraction

Abstraction

Encapsulation

Encapsulation

Inheritance

Inheritance

None

None

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice! \r\n \r\n","Keep trying! \r\n \r\n","Not bad! \r\n \r\n","Good work! \r\n \r\n","Perfect! \r\n \r\n"]
Hey ! Follow us on G+