Home
Current Affairs January 2024

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

Correct Answer :

B. friend


Related Questions

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

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

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

Class is similar to a variable.

A. True

B. False

What is the correct answer?

4

The && and || operators

A. Compare two numeric values

B. Combine two numeric values

C. Compare two Boolean values

D. Combine two Boolean values

What is the correct answer?

4

A class that contains at least one pure virtual function is called as

A. pure class

B. abstract class

C. base class

D. derived class

What is the correct answer?

4

An object is an allocated space in memory.

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

Private members of a structure can be accessed directly from the outside of the structure.

A. True

B. False

What is the correct answer?

4

Which of the following is not a component of file system

A. Access method

B. Auxiliary storage management

C. Free integrity mechanism

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

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

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

The ?: can be used to replace

A. if-else statement

B. wild cards

C. no meaning in C++

D. returns the value

What is the correct answer?

4

By default, members cannot be inherited.

A. True

B. False

What is the correct answer?

4

The template function declaration specifies

A. template class

B. a generic class

C. exception

D. identifier

What is the correct answer?

4

A destructor can have arguments like constructor.

A. True

B. False

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

The member of a structure can be directly accessed by

A. ->

B. dot operator

C. ::

D. >>

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

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

In case of nested class, enclosing class can directly access the private data member of nested class.

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

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

A. True

B. False

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

Reference to an object behaves like a constant pointer.

A. True

B. False

What is the correct answer?

4

Objects get destroyed in the reverse order as they are created.

A. True

B. False

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

In C++, the exception handler is invoked with a-

A. try block

B. throw exception

C. catch function

D. abort()

What is the correct answer?

4

The new operator always returns a void pointer.

A. True

B. False