Explore topic-wise MCQs in Attributes .

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

1.

If ListBox is class present in System.Windows.Forms namespace, then which of the following statements are the correct way to create an object of ListBox Class?

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

Which of the following statements are correct about a namespace used in C#.NET?

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

Which of the following is correct way to rewrite the C#.NET code snippet given below?

A. using System.Windows.Forms; using CtrlChars = Microsoft.VisualBasic.ControlChars; MessageBox.Show( "Wait for a" + CrLf + "miracle" );
B. using Microsoft.VisualBasic; using System.Windows.Forms; CtrlChars = ControlChars; MessageBox.Show( "Wait for a" + CtrlChars.CrLf + "miracle" );
C. using Microsoft.VisualBasic; using System.Windows.Forms; CtrlChars = ControlChars; MessageBox.Show ( "Wait for a" + CrLf + "miracle" );
D. using System.Windows.Forms; using CtrlChars = Microsoft.VisualBasic.ControlChars; MessageBox.Show( "Wait for a" + CtrlChars.CrLf + "miracle" );
Answer» E.
4.

Which of the followings are NOT a .NET namespace?

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

If a class called Point is present in namespace n1 as well as in namespace n2 , then which of the following is the correct way to use the Point class?

A. namespace IndiabixConsoleApplication { class MyProgram { static void Main(string[] args) { import n1; Point x = new Point(); x.fun(); import n2; Point y = new Point(); y.fun(); } } }
B. import n1; import n2; namespace IndiabixConsoleApplication { class MyProgram { static void Main(string[] args) { n1.Point x = new n1.Point(); x.fun(); n2.Point y = new n2.Point(); y.fun(); } } }
C. namespace IndiabixConsoleApplication { class MyProgram { static void Main( string [] args) { using n1; Point x = new Point(); x.fun(); using n2; Point y = new Point(); y.fun(); } } }
D. using n1; using n2; namespace IndiabixConsoleApplication { class MyProgram { static void Main( string [] args) { n1.Point x = new n1.Point(); x.fun(); n2.Point y = new n2.Point(); y.fun(); } } }
Answer» E.
6.

Which of the following statments are the correct way to call the method Issue() defined in the code snippet given below?

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