Home
Current Affairs January 2024

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

Correct Answer :

B. Permit data to be hidden from other classes


Related Questions

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

"[]" Operator is a unary operator.

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

this' pointer has to be used while accessing data members in a member function.

A. True

B. False

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

Class members are _______________ by default

A. Private

B. protected

C. public

D. None of the above are correct

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

When you overload an arithmetic assignment operator, the result

A. Goes in the object to the right of the operator

B. Goes in the object to the left of the operator

C. Goes in the object of which the operator is a member

D. Must be returned

What is the correct answer?

4

Static data member occurs in only class scope.

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

The library function exit() causes an exit from

A. The loop in which it occurs

B. The block in which it occurs

C. The function in which it occurs

D. The program in which it occurs

What is the correct answer?

4

Organizing data with methods that operate on the data and creating a new data type is called encapsulation.

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

iostream is inheried from istream, ostream and ios class.

A. True

B. False

What is the correct answer?

4

A normal C++ operator that acts in a special way on newly defined data types is said to be

A. Glorified

B. Encapsulated

C. Classified

D. Overloaded

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 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

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

A. True

B. False

What is the correct answer?

4

One of the major disadvantage with late binding is

A. the source code should be made available at compile time

B. the program runs slower

C. dynamic variables can not be used in the program

D. static variables can not be used

What is the correct answer?

4

Dynamic memory can be allocated by the following declaration

A. new

B. volatile

C. static

D. ==

What is the correct answer?

4

Pick out the most appropriate statement from the following

A. references are pointers

B. array of references can be created

C. you can not reference a reference variable

D. all of the above

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

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 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

Constructor returns void type value.

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

ios containes a pointer to streambuf.

A. True

B. False

What is the correct answer?

4

We cannot have the address of a constructor.

A. True

B. False

What is the correct answer?

4

Pick out the most appropriate statement

A. All variables must be declared before they are used

B. Variables in C++ need not be declared and the type can be assigned dynamically

C. Variables in C++ can be declared at the end of the program (before the main function terminates)

D. Variables can not be used explicitly in C++

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++