Home
Current Affairs January 2024

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

Correct Answer :

A. Only from the base class itself


Related Questions

What is the correct answer?

4

A constructor cannot be explicitly called.

A. True

B. False

What is the correct answer?

4

Overloaded functions

A. Are a group of functions with the same name

B. All have the same number and types of arguments

C. Make life simpler for programmer

D. May fail unexpectedly due to stress

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

Which of the following can legitimately be passed to a function?

A. A constant

B. A variable

C. A structure

D. A header file

What is the correct answer?

4

Scope resolution operator has the highest precedence.

A. True

B. False

What is the correct answer?

4

By default, members cannot be inherited.

A. True

B. False

What is the correct answer?

4

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

A. Two

B. One

C. No

D. None of the above

What is the correct answer?

4

When one object initializes another object the following function is invoked

A. copy constructor

B. new

C. instantiation

D. none of the above

What is the correct answer?

4

The break statement causes an exit

A. Only from the innermost loop

B. Only from the innermost switch

C. From all loops and switch

D. Only from the innermost loops or switch

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

What is the correct answer?

4

Friend function have access to the

A. private and protected members

B. public members only

C. private members only

D. None of the above are correct

What is the correct answer?

4

Class members are _______________ by default

A. Private

B. protected

C. public

D. None of the above are correct

What is the correct answer?

4

A member function can always access the data

A. In the object of which it is a member

B. In the class of which it is a member

C. In the object of the class of which it is a member

D. In the public part of its class

What is the correct answer?

4

We can make function inline by using the keyword 'inline'.

A. True

B. False

What is the correct answer?

4

Element double Array[7] is which element of the array?

A. sixth

B. seventh

C. eighth

D. impossible to tell

What is the correct answer?

4

The following syntax is valid. void inline gram_ panchayat :: show_gram_ panchayat_info().

A. True

B. False

What is the correct answer?

4

What is the output of the following program segment - for(i = 1, j = 0; i < 10; i++) j += i; cout <<i<<"
";

A. 10

B. 20

C. 55

D. there is an error in the program

What is the correct answer?

4

Delete operator is used

A. To allocate storage

B. To deallocate storage

C. To delete variable name

D. None of the above are correct

What is the correct answer?

4

In C++, the keyword auto can be used for

A. Automatic assignment of data to object during instantiation

B. Automatic call of a function

C. To declare a local variable

D. It is not a keyword in C++

What is the correct answer?

4

Class is similar to a variable.

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

By using protected, one can create class members that are private to their class but

A. that can not be inherited and accessed by a derived class

B. that can still be inherited and accessed by a derived class

C. that can be public

D. none of the above

What is the correct answer?

4

Static member functions have file scope.

A. True

B. False

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

The members of a class by default are private.

A. True

B. False

What is the correct answer?

4

A base class is inherited by

A. derived class

B. inline function

C. constructor

D. none of the above

What is the correct answer?

4

If a friend function is declared inside a class it can access all data members of the class.

A. True

B. False

What is the correct answer?

4

In a for loop with a multi-statement loop body, semicolons should appear following

A. The for statement itself

B. The closing brace in a multi-statement loop body

C. Each statement within the loop body.

D. The test expression

What is the correct answer?

4

A variable defined within a block is visible

A. From the point of definition onwards in the program

B. From the point of definition onwards in the function

C. From the point of definition onwards in the block

D. Throughout the function

What is the correct answer?

4

The exception is processed using

A. unexpected()

B. perform()

C. catch()

D. try()