C# MCQ SET


CSharp Multiple Choice Question Material
[1] Which of the following jobs are NOT performed by Garbage Collector? 1.Freeing memory on the stack. 2.Avoiding memory leaks. 3.Freeing memory occupied by unreferenced objects. 4.Closing unclosed database collections. 5.Closing unclosed files.
(A) => 1, 2, 3
(B) => 3, 5
(C) => 1, 4, 5
Answer =>> 1, 4, 5

[2] Which of the following .NET components can be used to remove unused references from the managed heap?
(A) => Common Language Infrastructure
(B) => CLR
(C) => Garbage Collector
Answer =>> Garbage Collector

[3] Which of the following statements correctly define .NET Framework?
(A) => It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web Services.
(B) => It is an environment for developing, building, deploying and executing only Web Applications.
(C) => It is an environment for developing, building, deploying and executing Distributed Applications.
Answer =>> It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web Services.

[4] Which of the following constitutes the .NET Framework? 1.ASP.NET Applications 2.CLR 3.Framework Class Library 4.WinForm Applications 5.Windows Services
(A) => 1, 2
(B) => 2, 3
(C) => 3, 4
Answer =>> 2, 3

[5] Which of the following assemblies can be stored in Global Assembly Cache?
(A) => Private Assemblies
(B) => Friend Assemblies
(C) => Shared Assemblies
Answer =>> Shared Assemblies

[6] Code that targets the Common Language Runtime is known as
(A) => Unmanaged
(B) => Distributed
(C) => Managed Code
Answer =>> Managed Code

[7] Which of the following statements is correct about the .NET Framework?
(A) => .NET Framework uses DCOM for making transition between managed and unmanaged code.
(B) => .NET Framework is built on the DCOM technology.
(C) => .NET Framework uses DCOM for achieving language interoperability.
Answer =>> .NET Framework uses DCOM for making transition between managed and unmanaged code.

[8] Which of the following is the root of the .NET type hierarchy?
(A) => System.Object
(B) => System.Type
(C) => System.Base
Answer =>> System.Object

[9] Which of the following benefits do we get on running managed code under CLR? 1.Type safety of the code running under CLR is assured. 2.It is ensured that an application would not access the memory that it is not authorized to access. 3.It launches separate process for every application running under it. 4.The resources are Garbage collected.
(A) => Only 1 and 2
(B) => Only 2, 3 and 4
(C) => Only 4
Answer =>> Only 4

[10] Which of the following security features can .NET applications avail?
(A) => PIN Security
(B) => Code Access Security
(C) => Both
Answer =>> Code Access Security

[11] Which of the following jobs are done by Common Language Runtime?
(A) => It provides core services such as memory management, thread management, and remoting.
(B) => It enforces strict type safety
(C) => Both
Answer =>> Both

[12] Which of the following statements are correct about a .NET Assembly?
(A) => It is the smallest deployable unit.
(B) => An assembly can contain only code and data.
(C) => An assembly is always in the form of an EXE file.
Answer =>> It is the smallest deployable unit.

[13] Which of the following statements are correct about JIT?
(A) => The instructions compiled by JIT compilers are written in native code.
(B) => The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.
(C) => The method is JIT compiled even if it is not called
Answer =>> The instructions compiled by JIT compilers are written in native code.

[14] Which of the following are parts of the .NET Framework?
(A) => The Framework Class Libraries (FCL)
(B) => Microsoft Published Web Services
(C) => Applications deployed on IIS
Answer =>> The Framework Class Libraries (FCL)

[15] Which of the following does not store a sign?
(A) => Short
(B) => Long
(C) => Byte
Answer =>> Byte

[16] What is the size of a Decimal?
(A) => 4 byte
(B) => 8 byte
(C) => 16 byte
Answer =>> 16 byte

[17] Which of the following is the correct size of a Decimal datatype?
(A) => 8 Bytes
(B) => 16 Bytes
(C) => 10 Bytes
Answer =>> 16 Bytes

[18] Which of the following statements are correct?
(A) => We can assign values of any type to variables of type object.
(B) => When a variable of a value type is converted to object, it is said to be unboxed.
(C) => When a variable of type object is converted to a value type, it is said to be boxed.
Answer =>> We can assign values of any type to variables of type object.

[19] Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be modified?
(A) => float pi = 3.14F;
(B) => #define pi 3.14F;
(C) => const float pi = 3.14F;
Answer =>> const float pi = 3.14F;

[20] Which of the following statements are correct about data types?
(A) => All value types are derived implicitly from System.ValueType class.
(B) => It is possible for a value type to contain the null value.
(C) => It is not essential that local variables in C# must be initialized before being used.
Answer =>> All value types are derived implicitly from System.ValueType class.

[21] Which of the following are the correct way to initialise the variables i and j to a value 10 each?
(A) => int i = 10, j = 10;
(B) => int i, j = 10;
(C) => int i = j = 10;
Answer =>> int i = 10, j = 10;

[22] Which of the following statement correctly assigns a value 33 to a variable c? byte a = 11, b = 22, c;
(A) => c = (byte) (a + b);
(B) => c = (byte) a + (byte) b;
(C) => c = (int) a + (int) b;
Answer =>> c = (byte) (a + b);

[23] Which of the following statements are correct about datatypes in C#.NET?
(A) => Every datatype is either a value type or a reference type.
(B) => Value types are always created on the heap.
(C) => Reference types are always created on the stack.
Answer =>> Every datatype is either a value type or a reference type.

[24] Which of the following is the correct default value of a Boolean type?
(A) => True
(B) => False
(C) => 0
Answer =>> False

[25] Which of the following statements is correct about the C#.NET code snippet given below? int d; d = Convert.ToInt32( !(30 < 20) );
(A) => A value 0 will be assigned to d.
(B) => A value 1 will be assigned to d.
(C) => A value -1 will be assigned to d.
Answer =>> A value 1 will be assigned to d.

[26] Which of the following is the correct output for the C#.NET code snippet given below? Console.WriteLine(13 / 2 + " " + 13 % 2);
(A) => 6.5 1
(B) => 6.5 0
(C) => 6 1
Answer =>> 6 1

[27] Which of the following statements are correct about the Bitwise & operator used in C#.NET?
(A) => The & operator can be used to Invert a bit.
(B) => The & operator can be used to put ON a bit.
(C) => The & operator can be used to put OFF a bit.
Answer =>> The & operator can be used to put OFF a bit.

[28] Which of the following are Logical operators in C#.NET?
(A) => !
(B) => Xor
(C) => %
Answer =>> !

[29] What will be the output of the C#.NET code snippet given below? int num = 1, z = 5; if (!(num <= 0)) Console.WriteLine( ++num + z++ + " " + ++z ); else Console.WriteLine( --num + z-- + " " + --z );
(A) => 5 6
(B) => 6 5
(C) => 7 7
Answer =>> 7 7

[30] Suppose n is a variable of the type Byte and we wish to put OFF its fourth bit (from right) without disturbing any other bits. Which of the following statements will do this correctly?
(A) => n = n && HF7
(B) => n = n & 16
(C) => n = n & 0xF7
Answer =>> n = n & 0xF7

[31] Which of the following statements is correct about Bitwise | operator used in C#.NET?
(A) => The | operator can be used to Invert a bit.
(B) => The | operator can be used to check whether a bit is ON.
(C) => The | operator can be used to put ON a bit.
Answer =>> The | operator can be used to put ON a bit.

[32] Which of the following is NOT an Assignment operator in C#.NET?
(A) => \=
(B) => /=
(C) => *=
Answer =>> \=

[33] What will be the output of the C#.NET code snippet given below? int i, j = 1, k; for (i = 0; i < 5; i++) { k = j++ + ++j; Console.Write(k + " "); }
(A) => 8 4 16 12 20
(B) => 4 8 12 16 20
(C) => 4 8 16 32 64
Answer =>> 4 8 12 16 20

[34] What will be the output of the C#.NET code snippet given below? int a = 10, b = 20, c = 30; int res = a < b ? a < c ? c : a : b; Console.WriteLine(res);
(A) => 10
(B) => 20
(C) => 30
Answer =>> 30

[35] Which of the following statements is correct about Bitwise ^ operator used in C#.NET?
(A) => The ^ operator can be used to put ON a bit.
(B) => The ^ operator can be used to put OFF a bit.
(C) => The ^ operator can be used to Invert a bit.
Answer =>> The ^ operator can be used to Invert a bit.

[36] Which of the following statements are correct?
(A) => The &* operator is also used to declare pointer types and to dereference pointers.
(B) => The -> operator combines pointer dereferencing and member access.
(C) => In addition to being used to specify the order of operations in an expression, brackets [ ] are used to specify casts or type conversions.
Answer =>> The -> operator combines pointer dereferencing and member access.

[37] Which of the following statements are correct?
(A) => C# allows a function to have arguments with default values.
(B) => C# allows a function to have variable number of arguments.
(C) => Omitting the return value type in method definition results into an exception.
Answer =>> C# allows a function to have variable number of arguments.

[38] If a procedure fun() is to receive an int, a Single & a double and it is to return a decimal then which of the following is the correct way of defining this procedure?
(A) => fun(int i, Single j, double k) decimal { ... }
(B) => static decimal fun(int i, Single j, double k) { ... }
(C) => A procedure can never return a value.
Answer =>> A procedure can never return a value.

[39] Which of the following statements are correct about functions used in C#.NET?
(A) => If we do not return a value from a function then a value -1 gets returned.
(B) => To return the control from middle of a function exit function should be used.
(C) => Function calls can be nested.
Answer =>> Function calls can be nested.

[40] How many values is a function capable of returning?
(A) => 1
(B) => 0
(C) => Any number of values.
Answer =>> 1

[41] How many values is a subroutine capable of returning?
(A) => Depends upon how many params arguments does it use.
(B) => Any number of values.
(C) => 0
Answer =>> 0

[42] Which of the following CANNOT occur multiple number of times in a program?
(A) => namespace
(B) => Entrypoint
(C) => Class
Answer =>> Entrypoint

[43] Which of the following statements are correct about subroutines used in C#.NET?
(A) => Subroutine can be called recursively.
(B) => To return the control from middle of a subroutine exit subroutine should be used.
(C) => Subroutine calls can be nested.
Answer =>> Subroutine can be called recursively.

[44] A function can be used in an expression, whereas a subroutine cannot be.
(A) => True
(B) => False
(C) => None
Answer =>> True

[45] In which of the following should the methods of a class differ if they are to be treated as overloaded methods?
(A) => Type of arguments
(B) => Number of arguments
(C) => Both
Answer =>> Both

[46] Can static procedures access instance data?
(A) => Yes
(B) => No
(C) => None
Answer =>> No

[47] Which of the following statements are correct about constructors in C#.NET?
(A) => Constructors are never called explicitly.
(B) => Constructors never return any value.
(C) => Both
Answer =>> Both

[48] How many times can a constructor be called during lifetime of the object?
(A) => As many times as we call it.
(B) => Only once.
(C) => Depends upon a Project Setting made in Visual Studio.NET.
Answer =>> Only once.

[49] Is it possible to invoke Garbage Collector explicitly?
(A) => Yes
(B) => No
(C) => None
Answer =>> Yes

[50] Which of the following statements is correct?
(A) => There is one garbage collector per program running in memory.
(B) => There is one common garbage collector for all programs.
(C) => An object is destroyed by the garbage collector when only one reference refers to it.
Answer =>> There is one common garbage collector for all programs.

[51] Is it possible for you to prevent an object from being created by using zero argument constructor?
(A) => Yes
(B) => No
(C) => None
Answer =>> Yes

[52] Which of the following statements are correct about static functions?
(A) => Static functions are invoked using objects of a class.
(B) => Static functions are outside the class scope.
(C) => Static functions are invoked using class.
Answer =>> Static functions are invoked using class.

[53] Which of the following statements is correct about constructors in C#.NET?
(A) => A constructor cannot be declared as private.
(B) => A constructor cannot be overloaded.
(C) => A constructor can be a static constructor.
Answer =>> A constructor can be a static constructor.

[54] Which of the following should be used to implement a 'Has a' relationship between two entities?
(A) => Polymorphism
(B) => Templates
(C) => Containership
Answer =>> Containership

[55] In an inheritance chain which of the following members of base class are accessible to the derived class members?
(A) => static
(B) => protected
(C) => private
Answer =>> protected

[56] Which of the following are reuse mechanisms available in C#.NET?
(A) => Inheritance
(B) => Encapsulation
(C) => Templates
Answer =>> Inheritance

[57] Which of the following should be used to implement a 'Like a' or a 'Kind of' relationship between two entities?
(A) => Polymorphism
(B) => Templates
(C) => Inheritance
Answer =>> Inheritance

[58] How can you prevent inheritance from a class in C#.NET ?
(A) => Declare the class as shadows.
(B) => Declare the class as overloads.
(C) => Declare the class as sealed.
Answer =>> Declare the class as sealed.

[59] Which of the following statements are correct about Inheritance in C#.NET?
(A) => A derived class object contains all the base class data.
(B) => Inheritance cannot suppress the base class functionality.
(C) => Inheritance cannot extend the base class functionality.
Answer =>> A derived class object contains all the base class data.

[60] 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.
Answer =>> While creating the object firstly the constructor of class A will be called followed by constructor of class B.

[61] If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?
(A) => s1 == s2
(B) => strcmp(s1, s2)
(C) => s1.Equals(s2)
Answer =>> s1.Equals(s2)

[62] Which of the following will be the correct output for the C#.NET code snippet given below? String s1="MYEXAM"; Console.Write(s1.IndexOf('Y') + " "); Console.Write(s1.Length);
(A) => 3 6
(B) => 1 5
(C) => 3 5
Answer =>> 1 5

[63] Which of the following statements about a String is correct?
(A) => A String is created on the stack.
(B) => A String is a primitive.
(C) => A String is created on the heap.
Answer =>> A String is created on the heap.

[64] Which of the following statement is correct about a String in C#.NET?
(A) => A String is mutable because it can be modified once it has been created.
(B) => Methods of the String class can be used to modify the string.
(C) => A String has a zero-based index.
Answer =>> A String has a zero-based index.

[65] Which of the following will be the correct output for the C#.NET code snippet given below? String s1 = "Five Star"; String s2 = "FIVE STAR"; int c; c = s1.CompareTo(s2); Console.WriteLine(c);
(A) => 0
(B) => 1
(C) => -1
Answer =>> -1

[66] If s1 and s2 are references to two strings then which of the following are the correct ways to find whether the contents of the two strings are equal?
(A) => int c; c = s1.CompareTo(s2);
(B) => if( strcmp(s1, s2) )
(C) => if (s1 is s2)
Answer =>> int c; c = s1.CompareTo(s2);

[67] Which of the following statements are correct about the String Class in C#.NET?
(A) => Two strings can be concatenated by using an expression of the form s3 = s1 + s2;
(B) => String is a primitive in C#.NET.
(C) => Both
Answer =>> Two strings can be concatenated by using an expression of the form s3 = s1 + s2;

[68] Which of the following statements are correct?
(A) => String is a value type.
(B) => String literals can contain any character literal including escape sequences.
(C) => The equality operators are defined to compare the values of string objects as well as references.
Answer =>> String literals can contain any character literal including escape sequences.

[69] Which of the following statements are correct?
(A) => A struct can contain properties.
(B) => A struct can contain constructors.
(C) => Both
Answer =>> Both

[70] C#.NET structures are always value types.
(A) => True
(B) => False
(C) => None
Answer =>> True

[71] When would a structure variable get destroyed?
(A) => When no reference refers to it, it will get garbage collected.
(B) => Depends upon whether it is created using new or without using new.
(C) => When it goes out of scope.
Answer =>> When it goes out of scope.

[72] Which of the following statements is correct?
(A) => A struct never declares a default constructor.
(B) => All value types in C# inherently derive from ValueType, which inherits from Object.
(C) => A struct never declares a default destructor.
Answer =>> All value types in C# inherently derive from ValueType, which inherits from Object.

[73] Which of the following are true about classes and struct?
(A) => A structure variable will always be created slower than an object.
(B) => A structure variable will die when it goes out of scope.
(C) => An object will die when it goes out of scope.
Answer =>> A structure variable will die when it goes out of scope.

[74] Which of the following statements are correct about Structures used in C#.NET?
(A) => struct members cannot be declared as protected.
(B) => A Structure can be empty.
(C) => It is an error to initialize an instance field in a struct.
Answer =>> struct members cannot be declared as protected.

[75] Which of the following statements are correct about a delegate?
(A) => Delegates are type-safe.
(B) => Delegates provide wrappers for function pointers.
(C) => Both
Answer =>> Both

[76] Which of the following statements are correct about delegates?
(A) => Delegates are not type-safe.
(B) => Delegate is a user-defined type.
(C) => Only one method can be bound with one delegate object.
Answer =>> Delegate is a user-defined type.

[77] Which of the following statements are correct about delegates?
(A) => Delegates cannot be used to call a static method of a class.
(B) => Delegates cannot be used to call procedures that receive variable number of arguments.
(C) => If signatures of two methods are same they can be called through the same delegate object.
Answer =>> Delegates cannot be used to call procedures that receive variable number of arguments.

[78] Which of the following are the correct ways to declare a delegate for calling the function func() defined in the sample class given below? class Sample { public int func(int i, Single j) { /* Add code here. */ } }
(A) => delegate d(int i, Single j);
(B) => delegate void d(int, Single);
(C) => delegate int d(int i, Single j);
Answer =>> delegate int d(int i, Single j);

[79] Suppose on pushing a button an object is to be notified, but it is not known until runtime which object should be notified. Which of the following programming constructs should be used to implement this idea?
(A) => Attribute
(B) => Delegate
(C) => Namespace
Answer =>> Delegate

[80] Which of the following statements is incorrect about a delegate?
(A) => A single delegate can invoke more than one method.
(B) => Delegates can be shared.
(C) => Delegate is a value type.
Answer =>> Delegate is a value type.

[81] Suppose a Generic class called SortObjects is to be made capable of sorting objects of any type (Integer, Single, Byte etc.). Which of the following programming constructs should be used to implement the comparision function?
(A) => Namespace
(B) => Delegate
(C) => Attribute
Answer =>> Delegate

[82] With which of the following can the ref keyword be used?
(A) => Static data
(B) => Instance data
(C) => Static function/subroutine
Answer =>> Static function/subroutine

[83] A property can be declared inside a namespace or a procedure.
(A) => True
(B) => False
(C) => None
Answer =>> False

[84] If Sample class has a Length property with get accessor then which of the following statements will work correctly?
(A) => Sample m = new Sample(); m.Length = 10;
(B) => Sample m = new Sample(); m.Length = m.Length + 20;
(C) => Sample m = new Sample(); int l; l = m.Length;
Answer =>> Sample m = new Sample(); int l; l = m.Length;

[85] An Account class has a property called accountNo and acc is a reference to a bank object and we want the C#.NET code snippet given below to work. Which of the following options will ensure this functionality? acc.accountNo = 10; Console.WriteLine(acc.accountNo);
(A) => Declare accountNo property with both get and set accessors.
(B) => Declare accountNo property with only get accessor.
(C) => Declare accountNo property with get, set and normal accessors.
Answer =>> Declare accountNo property with both get and set accessors.

[86] Which of the folowing does an indexer allow to index in the same way as an array?
(A) => A class
(B) => A property
(C) => A function
Answer =>> A class

[87] An Employee class has a property called age and emp is reference to a Employee object and we want the statement Console.WriteLine(emp.age) to fail. Which of the following options will ensure this functionality?
(A) => Declare age property with only get accessor.
(B) => Declare age property with only set accessor.
(C) => Declare age property with both get and set accessors.
Answer =>> Declare age property with only set accessor.

[88] Which of the followings are NOT a .NET namespace?
(A) => System.Web
(B) => System.Process
(C) => System.Data
Answer =>> System.Process

[89] Which of the following statements is correct about the using statement used in C#.NET?
(A) => using statement can be placed anywhere in the C#.NET source code file.
(B) => It is permitted to define a member at namespace level as a using alias.
(C) => A C#.NET source code file can contain any number of using statement.
Answer =>> A C#.NET source code file can contain any number of using statement.

[90] Which of the following statements are correct about a namespace used in C#.NET?
(A) => Classes must belong to a namespace, whereas structures need not.
(B) => Every class, struct, enum, delegate and interlace has to belong to some or the other namespace.
(C) => All elements of the namespace have to belong to one file.
Answer =>> Every class, struct, enum, delegate and interlace has to belong to some or the other namespace.

[91] Which of the following CANNOT belong to a C#.NET Namespace?
(A) => class
(B) => struct
(C) => Data
Answer =>> Data

[92] Which of the following statements is correct about a namespace used in C#.NET?
(A) => Nested namespaces are not allowed.
(B) => Importing outer namespace imports inner namespace.
(C) => Nested namespaces are allowed.
Answer =>> Nested namespaces are allowed.

[93] 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) => using System.Windows.Forms; ListBox lb = new ListBox();
(B) => System.Windows.Forms.ListBox lb = new System.Windows.Forms.ListBox();
(C) => Both
Answer =>> Both

[94] Which of the followings is the correct way to overload + operator?
(A) => public sample operator + ( sample a, sample b )
(B) => public abstract operator + ( sample a, sample b)
(C) => public static sample operator + ( sample a, sample b )
Answer =>> public static sample operator + ( sample a, sample b )

[95] Which of the following statements is correct?
(A) => Static methods can be a virtual method.
(B) => When overriding a method, the names and type signatures of the override method must be the same as the virtual method that is being overriden.
(C) => It is necessary to override a virtual method.
Answer =>> When overriding a method, the names and type signatures of the override method must be the same as the virtual method that is being overriden.

[96] Which of the following statements are correct?
(A) => All operators in C#.NET can be overloaded.
(B) => We can use the new modifier to modify a nested type if the nested type is hiding another type.
(C) => In case of operator overloading all parameters must be of the different type than the class or struct that declares the operator.
Answer =>> We can use the new modifier to modify a nested type if the nested type is hiding another type.

[97] Which of the following statements is correct?
(A) => The conditional logical operators cannot be overloaded.
(B) => When a binary operator is overloaded the corresponding assignment operator, if any, must be explicitly overloaded.
(C) => We can use the default equality operator in an overloaded implementation of the equality operator.
Answer =>> The conditional logical operators cannot be overloaded.

[98] Which of the following operators cannot be overloaded?
(A) => true
(B) => false
(C) => new
Answer =>> new

[99] Which of the following modifier is used when a virtual method is redefined by a derived class?
(A) => overloads
(B) => override
(C) => overridable
Answer =>> override

[100] In order for an instance of a derived class to completely take over a class member from a base class, the base class has to declare that member as
(A) => new
(B) => base
(C) => virtual
Answer =>> virtual

[101] Which of the following can be declared as a virtual in a class?
(A) => Methods
(B) => Properties
(C) => Both
Answer =>> Both

[102] Which of the following statements is correct?
(A) => Only one object can be created from an abstract class.
(B) => By default methods are virtual.
(C) => If a derived class does not provide its own version of virtual method then the one in the base class is used.
Answer =>> If a derived class does not provide its own version of virtual method then the one in the base class is used.

[103] Which of the following are necessary for Run-time Polymorphism?
(A) => The overridden base method must be virtual, abstract or override.
(B) => Both the override method and the virtual method must have the same access level modifier.
(C) => Both
Answer =>> Both

[104] Which of the following statements is correct about an interface used in C#.NET?
(A) => If a class implements an interface partially, then it becomes an abstract class.
(B) => A class cannot implement an interface partially.
(C) => An interface can contain static methods.
Answer =>> If a class implements an interface partially, then it becomes an abstract class.

[105] Which of the following statements is correct about an interface?
(A) => One interface can be implemented in another interface.
(B) => An interface can be implemented by multiple classes in the same program.
(C) => A class that implements an interface can explicitly implement members of that interface.
Answer =>> A class that implements an interface can explicitly implement members of that interface.

[106] Which of the following statements are correct about an interface in C#.NET?
(A) => A class can implement multiple interfaces.
(B) => Structures cannot inherit a class but can implement an interface.
(C) => Both
Answer =>> Both

[107] Which of the following statements is correct?
(A) => When a class inherits an interface it inherits member definitions as well as its implementations.
(B) => An interface cannot contain the signature of an indexer.
(C) => Interfaces members are automatically public.
Answer =>> Interfaces members are automatically public.

[108] Which of the following statements are correct about an interface used in C#.NET?
(A) => An interface can contain properties, methods and events.
(B) => The keyword must implement forces implementation of an interface.
(C) => Interfaces can be overloaded.
Answer =>> Interfaces can be overloaded.

[109] Which of the following can implement an interface?
(A) => Data
(B) => Class
(C) => Enum
Answer =>> Class

[110] Which of the following statements is correct?
(A) => A constructor can be used to set default values and limit instantiation.
(B) => C# provides a copy constructor.
(C) => Destructors are used with classes as well as structures.
Answer =>> A constructor can be used to set default values and limit instantiation.

[111] Which of the following statements are correct about static functions?
(A) => Static functions can access only static data.
(B) => Static functions cannot call instance functions.
(C) => Both
Answer =>> Both

[112] Which of the following statements is correct about constructors?
(A) => If we provide a one-argument constructor then the compiler still provides a zero-argument constructor.
(B) => Static constructors can use optional arguments.
(C) => If we do not provide a constructor, then the compiler provides a zero-argument constructor.
Answer =>> If we do not provide a constructor, then the compiler provides a zero-argument constructor.

[113] Which of the following statements are correct about data types?
(A) => Byte cannot be implicitly converted to float.
(B) => A char can be implicitly converted to only int data type.
(C) => We can cast the integral character codes.
Answer =>> We can cast the integral character codes.

[114] Which of the following is an 8-byte Integer?
(A) => Char
(B) => Long
(C) => Short
Answer =>> Long

[115] Which of the following is NOT an Integer?
(A) => Char
(B) => Byte
(C) => Integer
Answer =>> Char

[116] Which of the following statements is correct?
(A) => Information is never lost during narrowing conversions.
(B) => The CInteger() function can be used to convert a Single to an Integer.
(C) => Widening conversions take place automatically.
Answer =>> Widening conversions take place automatically.

[117] Which of the following are value types?
(A) => Integer
(B) => Array
(C) => None
Answer =>> Integer

[118] Which of the following statements is incorrect about delegate?
(A) => Delegates are reference types.
(B) => Delegates are type-safe.
(C) => Only one method can be called using a delegate.
Answer =>> Only one method can be called using a delegate.

[119] In which of the following areas are delegates commonly used?
(A) => Remoting
(B) => Serialization
(C) => Multithreading
Answer =>> Multithreading

[120] Which of the following is the necessary condition for implementing delegates?
(A) => Class declaration
(B) => Inheritance
(C) => Run-time Polymorphism
Answer =>> Class declaration

[121] Which of the following statements are correct?
(A) => An argument passed to a ref parameter need not be initialized first.
(B) => Variables passed as out arguments need to be initialized prior to being passed.
(C) => Argument that uses params keyword must be the last argument of variable argument list of a method.
Answer =>> Argument that uses params keyword must be the last argument of variable argument list of a method.

[122] A function returns a value, whereas a subroutine cannot return a value.
(A) => True
(B) => False
(C) => None
Answer =>> True

[123] Which of the following statements are correct about functions and subroutines used in C#.NET?
(A) => A function cannot be called from a subroutine.
(B) => The ref keyword causes arguments to be passed by reference.
(C) => A subroutine cannot be called from a function.
Answer =>> The ref keyword causes arguments to be passed by reference.

[124] Which of the following can be facilitated by the Inheritance mechanism?
(A) => Use the existing functionality of base class.
(B) => Overrride the existing functionality of base class.
(C) => Both
Answer =>> Both

[125] Which of the following can be declared in an interface?
(A) => Enumerations
(B) => Events
(C) => Structures
Answer =>> Events

[126] A class implements two interfaces each containing three methods. The class contains no instance data. Which of the following correctly indicate the size of the object created from this class?
(A) => 12 bytes
(B) => 24 bytes
(C) => 8 bytes
Answer =>> 24 bytes

[127] Which of the following statements is correct about an interface used in C#.NET?
(A) => One class can implement only one interface.
(B) => From two base interfaces a new interface cannot be inherited.
(C) => Properties can be declared inside an interface.
Answer =>> Properties can be declared inside an interface.

[128] Which of the following statements is correct about Interfaces used in C#.NET?
(A) => All interfaces are derived from an Object class.
(B) => Interfaces can be inherited.
(C) => All interfaces are derived from an Object interface.
Answer =>> Interfaces can be inherited.

[129] If a namespace is present in a library then which of the following is the correct way to use the elements of the namespace?
(A) => Add Reference of the namespace. Use the elements of the namespace.
(B) => Add Reference of the namespace. Import the namespace. Use the elements of the namespace.
(C) => Import the namespace. Use the elements of the namespace.
Answer =>> Add Reference of the namespace. Import the namespace. Use the elements of the namespace.

[130] Which of the following is NOT a namespace in the .NET Framework Class Library?
(A) => System.Process
(B) => System.Security
(C) => System.Threading
Answer =>> System.Process

[131] Which of the following statements is correct about a namespace in C#.NET?
(A) => Namespaces help us to control the visibility of the elements present in it.
(B) => A namespace can contain a class but not another namespace.
(C) => If not mentioned, then the name 'root' gets assigned to the namespace.
Answer =>> Namespaces help us to control the visibility of the elements present in it.

[132] Which of the following is absolutely neccessary to use a class Point present in namespace Graph stored in library?
(A) => Use fully qualified name of the Point class.
(B) => Use using statement before using the Point class.
(C) => Add Reference of the library before using the Point class.
Answer =>> Add Reference of the library before using the Point class.

[133] Which of the following statements are TRUE about the .NET CLR?
(A) => It provides a language-neutral development & execution environment.
(B) => It ensures that an application would not be able to access memory that it is not authorized to access.
(C) => Both
Answer =>> Both

[134] Which of the following are valid .NET CLR JIT performance counters?
(A) => Total memory used for JIT compilation
(B) => Average memory used for JIT compilation
(C) => Number of methods that failed to compile with the standard JIT
Answer =>> Number of methods that failed to compile with the standard JIT

[135] Which of the following statements is correct about Managed Code?
(A) => Managed code is the code that is written to target the services of the CLR.
(B) => Managed code is the code that runs on top of Windows.
(C) => Managed code is the code where resources are Garbage Collected.
Answer =>> Managed code is the code that is written to target the services of the CLR.

[136] Which of the following utilities can be used to compile managed assemblies into processor-specific native code?
(A) => gacutil
(B) => ngen
(C) => dumpbin
Answer =>> ngen

[137] Which of the following are NOT true about .NET Framework?
(A) => It provides a code-execution environment that minimizes software deployment and versioning conflicts.
(B) => It provides a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party.
(C) => It provides different programming models for Windows-based applications and Web-based applications.
Answer =>> It provides different programming models for Windows-based applications and Web-based applications.

[138] Which of the following are the correct ways to increment the value of variable a by 1?
(A) => ++a++;
(B) => a += 1;
(C) => a ++ 1;
Answer =>> a += 1;

[139] Which of the following is NOT an Arithmetic operator in C#.NET?
(A) => **
(B) => /
(C) => *
Answer =>> **

[140] Which of the following are NOT Relational operators in C#.NET?
(A) => >=
(B) => !=
(C) => Not
Answer =>> Not

[141] Which of the following is NOT a Bitwise operator in C#.NET?
(A) => &
(B) => |
(C) => <<
Answer =>> <<

[142] Which of the following unary operators can be overloaded?
(A) => +
(B) => new
(C) => is
Answer =>> +

[143] A derived class can stop virtual inheritance by declaring an override as
(A) => inherits
(B) => sealed
(C) => not inheritable
Answer =>> sealed

[144] Which of the following keyword is used to change the data and behavior of a base class by replacing a member of a base class with a new derived member?
(A) => new
(B) => base
(C) => overloads
Answer =>> new

[145] Which of the following statements is correct?
(A) => When used as a modifier, the new keyword explicitly hides a member inherited from a base class.
(B) => Operator overloading works in different ways for structures and classes.
(C) => It is not necessary that all operator overloads are static methods of the class.
Answer =>> When used as a modifier, the new keyword explicitly hides a member inherited from a base class.

[146] Which of the following keyword is used to overload user-defined types by defining static member functions?
(A) => op
(B) => opoverload
(C) => operator
Answer =>> operator

[147] A property can be declared inside a class, struct, Interface.
(A) => True
(B) => False
(C) => None
Answer =>> True

[148] Which of the following statements is correct about properties used in C#.NET?
(A) => A property can simultaneously be read only or write only.
(B) => A property can be either read only or write only.
(C) => A write only property will have only get accessor.
Answer =>> A property can be either read only or write only.

[149] The space required for structure variables is allocated on stack.
(A) => True
(B) => False
(C) => None
Answer =>> True

[150] Creating empty structures is allowed in C#.NET.
(A) => True
(B) => False
(C) => None
Answer =>> False