Explore topic-wise MCQs in Attributes .

This section includes 12 Mcqs, each offering curated multiple-choice questions to sharpen your Attributes knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following can be facilitated by the Inheritance mechanism? 1.Use the existing functionality of base class. 2.Overrride the existing functionality of base class. 3.Implement new functionality in the derived class. 4.Implement

A. 3, 4
B. 1, 2, 3
C. 3, 5
D. 2, 4, 5
Answer» C. 3, 5
2.

Which of the following is the correct way to create an object of the class Sample?

A. Declare the existing class as overloads.
B. Declare the existing class as shadows
C. Declare the existing class as suppress.
D. Declare the existing class as seale
Answer» B. Declare the existing class as shadows
3.

Which of the following statements are correct about Inheritance in C#.NET? 1.A derived class object contains all the base class data. 2.Inheritance cannot suppress the base class functionality. 3.A derived class may not be able to access

A. 2, 4, 5
B. 1, 2, 4
C. 2, 4
D. 1, 3, 5
Answer» C. 2, 4
4.

Which of the following statements are correct about Inheritance in C#.NET?

A. 1, 2, 4
B. 2, 4, 5
C. 1, 3, 5
D. 2, 4
Answer» D. 2, 4
5.

Which statement will you add in the function fun() of class B , if it is to produce the output "Welcome to IndiaBIX.com!" ?

A. base.fun();
B. A::fun();
C. fun();
D. mybase.fun();
Answer» B. A::fun();
6.

Assume class B is inherited from class A . Which of the following statements is correct about construction of an object of class B ?

A. While creating the object firstly the constructor of class B will be called followed by constructor of class A .
B. While creating the object firstly the constructor of class A will be called followed by constructor of class B .
C. The constructor of only class B will be called.
D. The constructor of only class A will be called.
Answer» C. The constructor of only class B will be called.
7.

Which of the following are reuse mechanisms available in C#.NET?

A. 1, 4
B. 1, 3
C. 2, 4
D. 3, 5
Answer» B. 1, 3
8.

In an inheritance chain which of the following members of base class are accessible to the derived class members?

A. 1, 3
B. 2, 5
C. 3, 4
D. 4, 5
Answer» C. 3, 4
9.

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

A. The program gives the output as: Hi Hello Bye
B. The program gives the output as: Bye Hello
C. The program gives the output as: Hi Bye Hello
D. Error in the program
Answer» C. The program gives the output as: Hi Bye Hello
10.

What will be the size of the object created by the following C#.NET code snippet?

A. 24 bytes
B. 12 bytes
C. 20 bytes
D. 10 bytes
Answer» B. 12 bytes
11.

Which of the following statements should be added to the subroutine fun( ) if the C#.NET code snippet given below is to output 9 13?

A. Console.WriteLine(base.i + " " + i);
B. Console.WriteLine(i + " " + base.i);
C. Console.WriteLine(mybase.i + " " + i);
D. Console.WriteLine(i + " " + mybase.i);
Answer» C. Console.WriteLine(mybase.i + " " + i);
12.

Which of the following can be facilitated by the Inheritance mechanism?

A. 1, 2, 3
B. 3, 4
C. 2, 4, 5
D. 3, 5
Answer» B. 3, 4