header1.html

Tuesday 30 July 2013

C# 4.0 MCQs(Multiple Choice Questions)


After Basic set of asp.net MCQs lets try for some advance topics.

1.The infrastructure that supports these dynamic operations at run time is called the__________.
A.CLR
B.CTS
C.CLS
D.DLR
Click for answer 

D. DLR(Dynamic Language Runtime).
2.The___________keyword is new to C# 4.0, and is used to tell the compiler that a variable's type can change or that it is not known until runtime.
A.Covariance
B.dynamic
C.Contravariance
D.Object
Click for answer 

B.dynamic
3.___________methods are not supported for dynamic types.
A.Anonymous
B.Static
C.Abstract
D.Extension
Click for answer 

D.Extension
4.myMobile.Accept(55, inReject: false); Above statement is an example of which new concept of C# 4.0?
A.Named Parameters
B.Optional Parameters
C.dynamic
D.Variance
Click for answer 

A.Named Parameters
5.COM Interop is simplified in C#4.0 e.g.var doc = Application.GetDocument("MyFile.txt"); In above statement_______ keyword was essential in parameters of GetDocument() in previous versions of C#.
A.out
B.named
C.base
D.ref
Click for answer 

D.ref
6.Covariance and Contravariance are new features introduced in C# 4.0.True/False?
A.False
B.True
Click for answer 

B.True
7._________parameters allows you to give a method parameter a default value so that you do not have to specify it every time you call the method.
A.optional
B.named
C.out
D.ref
Click for answer 

A.optional
8.Duck typing is implemented by using_________ keyword.
A.dynamic
B.object
C.ref
D.base
Click for answer 

A.dynamic