Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

C++ Programming

Cpp Programming Quiz 258 – Constructors __________ to allow different approaches of object construction.

Question: Constructors __________ to allow different approaches of object construction.
[A].
cannot overloaded
[B].

can be overloaded
[C].

can be called
[D].

can be nested 

Answer: Option B

Explanation:

No answer description available for this question.

Cpp Programming Quiz 258 – Constructors __________ to allow different approaches of object construction. Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 259 – Which of the following statement is correct about destructors?

Question: Which of the following statement is correct about destructors?
[A].
A destructor has void return type.
[B].

A destructor has integer return type.
[C].

A destructor has no return type.
[D].

A destructors return type is always same as that of main(). 

Answer: Option C

Explanation:

No answer description available for this question.

Cpp Programming Quiz 259 – Which of the following statement is correct about destructors? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 260 – Which of the following statement is correct about constructors?

Question: Which of the following statement is correct about constructors?
[A].
A constructor has a return type.
[B].

A constructor cannot contain a function call.
[C].

A constructor has no return type.
[D].

A constructor has a void return type. 

Answer: Option C

Explanation:

No answer description available for this question.

Cpp Programming Quiz 260 – Which of the following statement is correct about constructors? Read More »

Constructors And Destructors, Cpp Programming

Which of the following statements are correct about 6 used in the program?int num[6];num[6]=21;

Question: Which of the following statements are correct about 6 used in the program?int num[6];num[6]=21;
[A].

In the first statement 6 specifies a particular element, whereas in the second statement it specifies a type.

[B].

In the first statement 6 specifies a array size, whereas in the second statement it specifies a particular element of array.

[C].

In the first statement 6 specifies a particular element, whereas in the second statement it specifies a array size.

[D].

In both the statement 6 specifies array size.

Answer: Option B

Explanation:

The statement ‘B’ is correct, because int num[6]; specifies the size of array and num[6]=21; designates the particular element(7th element) of the array.

Which of the following statements are correct about 6 used in the program?int num[6];num[6]=21; Read More »

Arrays, C Programming

Cpp Programming Quiz 261 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A].
A destructor has the same name as the class in which it is present.
[B].

A destructor has a different name than the class in which it is present.
[C].

A destructor always returns an integer.
[D].

A destructor can be overloaded. 

Answer: Option A

Explanation:

No answer description available for this question.

Cpp Programming Quiz 261 – Which of the following statement is correct? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 262 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A].
A constructor has the same name as the class in which it is present.
[B].

A constructor has a different name than the class in which it is present.
[C].

A constructor always returns an integer.
[D].

A constructor cannot be overloaded. 

Answer: Option A

Explanation:

No answer description available for this question.

Cpp Programming Quiz 262 – Which of the following statement is correct? Read More »

Constructors And Destructors, Cpp Programming

Which of the following statements are correct about an array?

Question: Which of the following statements are correct about an array?

[A].

1

[B].

1,4

[C].

2,3

[D].

2,4

Answer: Option B

Explanation:

1. The array int num[26]; can store 26 elements. This statement is true.

2. The expression num[1] designates the very first element in the array. This statement is false, because it designates the second element of the array.

3. It is necessary to initialize the array at the time of declaration. This statement is false.

4. The declaration num[SIZE] is allowed if SIZE is a macro. This statement is true, because the MACRO just replaces the symbol SIZE with given value.

Hence the statements ‘1’ and ‘4’ are correct statements.

Which of the following statements are correct about an array? Read More »

Arrays, C Programming

Cpp Programming Quiz 263 – Which of the following gets called when an object goes out of scope?

Question: Which of the following gets called when an object goes out of scope?
[A].
constructor
[B].

destructor
[C].

main
[D].

virtual function 

Answer: Option B

Explanation:

No answer description available for this question.

Cpp Programming Quiz 263 – Which of the following gets called when an object goes out of scope? Read More »

Constructors And Destructors, Cpp Programming

Which of the following statements is correct about the C#.NET code snippet given below?

Question: Which of the following statements is correct about the C#.NET code snippet given below?

[A].

intMyArr is a reference to an object of System.Array Class.

[B].

intMyArr is a reference to an object of a class that the compiler derives from System.Array Class.

[C].

intMyArr is a reference to an array of integers.

[D].

intMyArr is a reference to an object created on the stack.

Answer: Option B

Explanation:

No answer description available for this question.

Which of the following statements is correct about the C#.NET code snippet given below? Read More »

Arrays, C Sharp Programming

Cpp Programming Quiz 264 – Which of the following gets called when an object is being created?

Question: Which of the following gets called when an object is being created?
[A].
constructor
[B].

virtual function
[C].

destructor
[D].

main 

Answer: Option A

Explanation:

No answer description available for this question.

Cpp Programming Quiz 264 – Which of the following gets called when an object is being created? Read More »

Constructors And Destructors, Cpp Programming