Home
Current Affairs January 2024

What is the correct answer?

4

Protected data members can be accessed

A. Only from the base class itself

B. Both form the base class and from its derived classes

C. From the class which is friend of the base class

D. None of the above are correct

Correct Answer :

B. Both form the base class and from its derived classes


Related Questions

What is the correct answer?

4

Which of the following are good reasons to use an object oriented language?

A. You can define your data types

B. Program statements are simpler than in procedural languages.

C. An OO program can be taught to correct its own errors.

D. It's easier to conceptualize an OO program.

What is the correct answer?

4

One of the important features of an abstract class is

A. it need not have any object

B. it should be used only as a derived class

C. it need not have any members

D. none of the above

What is the correct answer?

4

_______ argument(s) are passed in case of unary overloaded operators.

A. Two

B. One

C. No

D. None of the above

What is the correct answer?

4

new operator is used

A. To dynamically allocate storage

B. To statically allocate storage

C. To allocate storage for a new variable

D. None of the above are correct

What is the correct answer?

4

An object is an allocated space in memory.

A. True

B. False

What is the correct answer?

4

In C++, an identifier must be initialized using constant expression.

A. True

B. False

What is the correct answer?

4

In C++, identifiers have to be declared at the beginning of the blocks.

A. True

B. False

What is the correct answer?

4

Which of the following relationship is known as inheritancerelationship?

A. ‘has-a’ relationship

B. ‘is-a’ relationship

C. association relationship

D. none of the above

What is the correct answer?

4

Constructor returns void type value.

A. True

B. False

What is the correct answer?

4

Data objects can be initialized when allocating memory using 'new'.

A. True

B. False

What is the correct answer?

4

A function that is called automatically when an object is created is known as

A. instantiation

B. function prototype

C. constructor

D. structure

What is the correct answer?

4

A pure virtual function is a virtual function that has

A. no definition in its base class

B. a definition in its base class

C. a definition in at least one derived class

D. definition in base class and at least one derived class

What is the correct answer?

4

Static data member can be declared as const too.

A. True

B. False

What is the correct answer?

4

Private data members can be accessed

A. Only from the base class itself

B. Both from the base class and form its derived classes

C. From the class which is a friend of the base class

D. None of the above is correct

What is the correct answer?

4

Sharing of common information are achieved by the concept of

A. Virtual copying

B. Inheritance

C. Encapsulation

D. None of these

What is the correct answer?

4

It is possible to allow non member function access to private members of a class by declaring it as

A. public

B. friend

C. private

D. not possible

What is the correct answer?

4

By default, C++ uses the following method of passing arguments

A. Call-by-Reference

B. Call-by-Value

C. Call-by-Pointer

D. None of the above

What is the correct answer?

4

Classes are useful because they

A. Are removed from memory when not in use

B. Permit data to be hidden from other classes

C. Bring together all aspects of an entity in one place

D. Can closely model objects in the real world

What is the correct answer?

4

The member of a structure can be directly accessed by

A. ->

B. dot operator

C. ::

D. >>

What is the correct answer?

4

In C++, the stream base class is

A. iostream

B. iofstream

C. ios

D. stdio

What is the correct answer?

4

"[]" Operator is a unary operator.

A. True

B. False

What is the correct answer?

4

Inline functions_____________ call overload.

A. Increase

B. Reduce

C. None of the above are correct

What is the correct answer?

4

A copy constructor is used to copy an object member wise to another object of the same class.

A. True

B. False

What is the correct answer?

4

Protected members cannot be inherited.

A. True

B. False

What is the correct answer?

4

The getch() library function

A. Returns a character when any key is pressed

B. Returns a character when ENTER is pressed

C. Display a character on the screen when a key is pressed

D. Does not display a character on the screen

What is the correct answer?

4

Scope resolution operator has the highest precedence.

A. True

B. False

What is the correct answer?

4

Static member functions have file scope.

A. True

B. False

What is the correct answer?

4

In a class, only the member function can access data, which is not accessible to outside. This feature is called:

A. Data security

B. Data hiding

C. Data manipulation

D. Data definition

What is the correct answer?

4

What is the value of Friday in the following - enum days { Monday, Tuesday, Wednesday = -1, Thursday, Friday, Saturday = 6, Sunday}

A. 1

B. 5

C. 0

D. -3

What is the correct answer?

4

A destructor can have a return type.

A. True

B. False