Explore topic-wise MCQs in ASPDotNET (MCQ) questions and answers.

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

1.

Trace the outputnamespace A{class MyClass{public void fun(){Console.WriteLine("C # is fun");}}namespace B{class MyClass{public void fun(){Console.WriteLine("C # is interesting");}}}}Consider the above code what will be the output of following programclass Program{static void Main(string[] args){A.MyClass obj = new A.MyClass(); obj.fun();}}

A. C # is interesting
B. C # is fun
C. cmpile time error
D. None of the above
Answer» C. cmpile time error
2.

Which of the following are correct?1. Delegates are like C++ function pointers.2. Delegates allow methods to be passed as parameters.3. Delegates can be used to define callback methods.4. Delegates are not type safe.

A. 1,3,4
B. 1,2,3
C. 2,3,4
D. All of the above
Answer» C. 2,3,4
3.

Trace the outputclass Myclass{publicint count = 0;publicMyclass(){count++;}}class Program{static void Main(string[] args){Myclass obj1 = new Myclass(); Console.WriteLine(obj1.count);Myclass obj2 = new Myclass();Console.WriteLine(obj2.count);Myclass obj3 = new Myclass();Console.WriteLine(obj3.count);}}

A. 1, 1, 1
B. 1, 2, 3
C. 0, 1, 2
D. All of the above
Answer» B. 1, 2, 3
4.

Trace the outputnamespace A{class MyClass{public void fun(){Console.WriteLine( " C # is fun " );}}namespace B{class MyClass{public void fun(){Console.WriteLine( " C # is interesting " );}}}}Consider the above code what will be the output of following programclass Program{static void Main(string[] args){A.B.MyClass obj = new A.B.MyClass();obj.fun();}}

A. C # is interesting
B. C # is fun
C. compile time error
D. None of the above
Answer» B. C # is fun
5.

Which of the following are correct?1. An interface can be instantiated directly.2. Interfaces can contain constructor.3. Interfaces contain no implementation of methods.4. Classes and structs can implement more than one interface.5. An interface itself can inherit from multiple interfaces.

A. 3,4,5
B. 1,2,3
C. 2,3,4
D. All of the above
Answer» B. 1,2,3
6.

Choose the correct one1) XML serialization serializes the public fields and properties of an object.2) XML serialization serializes the private fields and properties of an object.3) XML serialization serializes only the public methods.

A. Only 1
B. Only 2
C. Only 1 & 2
D. All of the above
Answer» B. Only 2
7.

Properties in .NET can be declare as1. Static, Protected internal, Virtual2. Public, internal, Protected internal3. Only public 4. None

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

Which of the following statements are correct?1. Indexers enable objects to be indexed in a similar manner to arrays.2. The this keyword is used to define the indexers.3. Indexers can be overloaded.4. Indexer cannot be used in interface

A. 1, 2
B. 3
C. 1,2,3
D. None of the above
Answer» D. None of the above
9.

Choose the correct one1) Sealed class can be declared as abstract2) Abstract class cannot be declared as abstract3) Abstract class canbe declared as abstract

A. Only 1
B. Only 2
C. Only 1 & 2
D. All of the above
Answer» B. Only 2
10.

You need to identify a type that meets the following criteria: Is always a number. Is not greater than 65,535. Which type should you choose?

A. System.UInt16
B. int
C. System.String
D. System.IntPtr
Answer» B. int
11.

Thread class has the following property.A. ManagedThreadIDB. IsBackgroundC. IsBackgroundColorD. Abort

A. 1, 2
B. 1, 4
C. 4
D. 1 ,2, 4
Answer» B. 1, 4
12.

You want to configure the application to use the following authorization rules in web.config file. Anonymous users must not be allowed to access the application. All employees except ABC must be allowed to access the application.

A. <authorization> <deny users= ABC > <allow users= * > <deny users= ? > </authorization>
B. <authorization> <allow users= * > <deny users= ABC > <deny users= ? > </authorization>
C. <authorization> <allow users= ABC > <allow users= * > </authorization>
D. <authorization> <deny users= ABC > <deny users= ? > <allow users= * > </authorization>
Answer» E.