Our experts have gathered these DotNet using C# MCQs through research, and we hope that you will be able to see how much knowledge base you have for the subject of DotNet using C# by answering these 100+ multiple-choice questions.
Get started now by scrolling down!
A. A delegate requires an instance method be supplied.
B. A delegate instance may encapsulate only one method
C. Delegates are not typesafe
D. A delegate instance does not know or care about the class type of the encapsulated method
A. sorted by Key
B. sorted by Element
C. not sorted
A. ObjRef
B. MarshalByRefObject
C. ObjectHandle
D. RemotingServices
A. System.Reflection.PropertyInfo
B. System.Reflection.EventInfo
C. System.Type
D. System.Reflection.InstanceInfo
A. Exceptions should be derived from the System.Exception, but are not required to do so.
B. If no catch block is found for an exception, and the source is not a static constructor, a System.ThreadException will be thrown
C. Mathematical errors such as divide by zero, or numeric overflow will generate an exception that is derived from System.Exception
D. Every throw statement must have at least one catch block
A. not supported except for implementing an indexer.
B. properties which take one or more parameters (e.g. to retrieve one element from a member collection)
C. properies which use one or more attributes to control their behavior
D. properties which can be passed as Method Parameters so they can be invoked by the called method.
A. It provides synchronized operations viewing the content either as an XmlDocument or as a DataSet
B. It provides the basic abilities for XMLDocument instances to be created from or exported to DataSets
C. It provides a limited set of capabilities compared to the System.Xml.XmlDocument class
D. It provides the basic abilities to allow DataSets to be loaded from or exported to XML files.
A. A while statement will always execute its body at least once.
B. A for loop will always execute its body at least once.
C. A try statement must always include at least one catch block
D. A case clause within a switch statement may not fall through to the next case clause
A. Enums are always equated to an integral constant value
B. A variable of the enum type will always contain one of the declared symbolic constants
C. The declared values of an enum are always assigned sequential starting with 0
D. The declared values of an enum must be mapped (explicitly or implicitly) to unique integral values
A. Prevention of the caught exception from leaving the catch block
B. Allowing the original exception to propagate after it has been caught, with all of the information (including context) intact
C. Wrapping the caught exception inside a newly created exception of a different type
D. Generating a new exception with no information about the original exception
E. Altering the Message , TargetSite and/or StackTrace, of the existing exception before re-throwing
A. It renders the resources unavailable.
B. It ensures that resources are used only with the appropriate culture
C. It prevents identifier collisions between multiple satellite assemblies
D. It has no impact since access specifiers for resources are not applied.
A. C# does not support the use of "*" to indicate a pointer.
B. Pointers are a type derived from System.Object
C. Pointers can be used as out and ref type parameters
D. Pointer references are tracked by the garbage collector.
A. Added
B. Modified
C. Dirty
D. Detached
E. Deleted
A. Methods
B. Events
C. Fields
D. Indexers
A. class SampleClass {}
class SampleClass<T> {}
B. class SampleClass<T> {}
class SampleClass<T,U> {}
C. class SampleClass<T> where T : class { }
class SampleClass<T> where T : struct { }
D. class SampleClass {}
class SampleClass<T> where T : class { }
A. If a class implements an interface, the implementation can be provided by a public member of a base class.
B. A class may partially implement an interface by only declaring some of the members
C. Interface methods may be implemented so that they are NOT directly accessible using an instance reference to the class
D. Since interface implementation methods can not be declared private,protected, or internal, they are always accessible from any point in an application
A. Manifest
B. MetaData
C. Intermediate Language Code
D. Resources
E. Native Executable Code
A. The Conditional Operator (?:) has the lowest precedence.
B. All binary operators are left-associative, and evaluate from left to right.
C. The Assignment and Conditional Operators are right-associative.
D. The Conditional And (&&) and Or (||) operators have higher precedence than the Logical And (&) and Or (|) operators.
A. Identifier
B. Whitespace
C. Punctuator
D. Operator
E. All of the above
A. #define
B. #line
C. #include
D. #error
E. #pragma
A. It physically includes the native code for puts in the current assembly
B. It generates a wrapper class for the puts method
C. It provides sufficient information so the Platform Invoke functionality can be used to call the function in the msvcrt.dll
D. It enables an unsafe code
A. A single assembly may contain multiple namespaces
B. The same namespace may be used in multiple assemblies
C. Namespaces may be aliased to provide a shorthand notation for a fully qualified identifier
D. All of the above
A. Trace is enabled for both Release and Debug initial configurations
B. Trace can be controlled both by preprocessor directives, and compiler directives
C. To change the severity levels which generate output, you must recompile your program
D. All of the Above
A. ASCII
B. Unicode
C. UTF-7
D. UTF-8
E. EBCDIC
A. One method may handle events from different sources
B. A single event can be handled by multiple methods
C. Event handlers can be dynamically added and removed at runtime
D. All of the above
A. For reference types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
B. For value types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
C. Assignments to arrays elements may require a runtime check to validate the type safety of the assignment
A. It provides communication across heterogeneous networks
B. It provides communication when one of the endpoints may be off-line
C. It may behave differently depending on the current operating system
D. A new system level queue may be created simply by creating an instance of MessageQueue.
A. SQL Server
B. ADO.NET
C. MSMQ
D. Microsoft Distributed Transaction Coordinator (MSDTC).
E. All of the above
A. Integral types are considered equal if they represent the same value.
B. Object types are considered equal if they both refer to the same object or if both are null
C. String types are considered equal if they have identical lengths and identical characters in each character position
D. String types are considered equal if they have identical dimensions and identical content at each array index
A. Usage of system settings for size, color, and font
B. Support for Windows "High Contrast" option
C. Usage of sound to notify of critical information
D. Keyboard only access to all features including menus, and controls
A. Changes to value parameters always involve making a copy of the original argument
B. Items passed as Reference Parameters must be initialized prior to the call
C. Output Parameters do not need to be assigned inside the method
D. Variable Length argument lists are not supported
A. Start
B. Continue
C. Pause
D. Restart
A. It is a statement block which may contain a yield return statement to provide the next value of the iteration
B. It is a statement block which may contain a yield break statement to provide the next value of the iteration
C. It is a statement block which may contain a yield return statement to indicate that the iteration is complete
D. It is a statement block which may contain a yield break statement to indicate that the iteration is complete
E. It is a class which implements Ienumerable
A. int
B. sbyte
C. long
D. All of the above
A. Assigning a GUID to each exposed interface and implementation via the System.Runtime.InteropServices.GuidAttribute
B. Enabling an unsafe code
C. Registering the server assembly with the system using RegAsm.exe
D. Registering the server assembly with the system using RegSvc32.exe
A. It always references the UTC (GMT) time
B. It always references the Local time
C. It contains a member indicating which time zone it refers to
D. It contains a member indicating whether it is UTC, Local, or Unspecified
A. The appropriate version of the .NET framework must be installed.
B. All application components must be in the application directory, or a subdirectory.
C. Shared components can be installed as part of the XCOPY.
D. XCOPY deployment to a non-empty target directory may have unintended side-effects
A. separating an item's public interface from the actual implementation
B. embedding content as a resource into an executable program
C. providing a short summary description of complex operations
D. a technique using base and derived classes
A. you should modify the COM component to enable CLR functionallity.
B. you should use TlbImp.exe to create a managed wrapper
C. you should use TlbExp.exe to create a managed wrapper
D. you should enable an unsafe code
A. It is impossible to add a reference to both assemblies to any given assembly
B. A new root can be added to the assemblies namespace hierarchy by the use of an extern alias
C. The specific colliding name may be altered by using an extern alias
D. The collision may be avoided by using a statement to provide an alias
A. Methods
B. Properties
C. Fields
D. Conversion operators
E. Events
A. Static constructors are called before the main program is executed
B. Static constructors are called before the first instance of a class is created
C. Static constructors are called before any static (non-constructor) members are called
D. Static constructors can take parameters
A. DataContractAttribute
B. DataMemberAttribute
C. EnumMemberAttribute
D. CollectionDataContractAttribute
E. DataObjectAttribute
A. public static void Main() {}
B. public static int Main() {}
C. public static int Main(string[] args) {}
D. public static int Main(string cmdline) {}
E. private static int Main(string[] args) {}
A. Call the Type.MakeGenericType() method on an instance of System.Type which represents the Generic, specifying the types of the generic parameters.
B. Call the static Type.MakeGenericType(...) method specifying both the base type and the types of the generic parameters.
C. Call the GetType() method on an instance of the specialization
D. Call Reflection.Emit()
E. Call the Type.GetGenericTypeDefinition() method
A. 10
B. 20
C. Some value equal to or larger than 13
D. Int32.MaxValue
A. Dim list As New List(Of Fruit)
list.Add(New Apple)
list.Add(New Fruit)
B. Dim list As New List(Of Fruit)
list.Add(New Apple)
list.Add(New Fruit)
C. Dim list As New List(Of Apple)
list.Add(New Apple)
list.Add(New Fruit)
D. Dim list As New List(Of Apple)
list.Add(New Apple)
list.Add(New Fruit)
A. valueList.Insert(values)
B. valueList = values
C. valueList.Add(values)
D. valueList.AddRange(values)
A. System.DbNull.Value
B. TRUE
C. FALSE
D. Nothing
E. None of the above (An InvalidCastException is thrown)
A. Dim sr As New System.IO.StreamReader("C:\temp\myfile.txt")
Dim s As String = sr.ReadLine
B. Dim sr As New System.IO.StreamReader("C:\temp\myfile.txt")
Dim s As String = sr.Read
C. Dim sr As New System.IO.StreamReader("C:\temp\myfile.txt")
Dim s As String = sr.ReadAll
D. Dim s As String = My.Computer.FileSystem.ReadAllText(