1. Which of the following statements are TRUE about the .NET CLR?
1. It provides a language-neutral development & execution environment.
2. It ensures that an application would not be able to access memory that it is not authorized to access.
3. It provides services to run "managed" applications.
4. The resources are garbage collected.
5. It provides services to run "unmanaged" applications.
Correct : C. 1,2,3,4
2. Which of the following are valid .NET CLR JIT performance counters?
1. Total memory used for JIT compilation
2. Average memory used for JIT compilation
3. Number of methods that failed to compile with the standard JIT
4. Percentage of processor time spent performing JIT compilation
5. Percentage of memory currently dedicated for JIT compilation
Correct : B. 3,4
3. Which of the following statements is correct about Managed Code?
Correct : D. Managed code is the code that is written to target the services of the CLR.
4. Which of the following are NOT true about .NET Framework?
1. It provides a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.
2. It provides a code-execution environment that minimizes software deployment and versioning conflicts.
3. It provides a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party.
4. It provides different programming models for Windows-based applications and Web-based applications.
5. It provides an event driven programming model for building Windows Device Drivers.
Correct : C. 4,5
5. Which of the following components of the .NET framework provide an extensible set of classes that can be used by any .NET compliant programming language?
Correct : A. NET class libraries
6. Which of the following .NET components can be used to remove unused references from the managed heap?
Correct : C. Garbage Collector
7. Which of the following statements correctly define .NET Framework?
Correct : A. It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web Services
8. Which of the following constitutes the .NET Framework?
1. ASP.NET Applications
2. CLR
3. Framework Class Library
4. WinForm Applications
5. Windows Services
Correct : B. 2,3
9. Which of the following assemblies can be stored in Global Assembly Cache?
Correct : C. Shared Assemblies
10. Code that targets the Common Language Runtime is known as
Correct : D. Managed code
11. Which of the following statements is correct about the .NET Framework?
Correct : C. NET Framework uses DCOM for making transition between managed and unmanaged code.
12. 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.
Correct : D. All of the above
13. Which of the following jobs are done by Common Language Runtime?
1. It provides core services such as memory management, thread management, and remoting.
2. It enforces strict type safety.
3. It provides Code Access Security.
4. It provides Garbage Collection Services.
Correct : D. All of the above
14. Which of the following statements are correct about a .NET Assembly?
1. It is the smallest deployable unit.
2. Each assembly has only one entry point - Main(), WinMain() or DLLMain().
3. An assembly can be a Shared assembly or a Private assembly.
4. An assembly can contain only code and data.
5. An assembly is always in the form of an EXE file.
Correct : D. 1,2
15. Which of the following statements are correct about JIT?
1. JIT compiler compiles instructions into machine code at run time.
2. The code compiler by the JIT compiler runs under CLR.
3. The instructions compiled by JIT compilers are written in native code.
4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.
5. The method is JIT compiled even if it is not called
Correct : A. 1, 2, 3
16. Which of the following are parts of the .NET Framework?
1. The Common Language Runtime (CLR)
2. The Framework Class Libraries (FCL)
3. Microsoft Published Web Services
4. Applications deployed on IIS
5. Mobile Applications
Correct : B. Only 1, 2
17. In C#, a subroutine is called a ________.
Correct : C. Method
18. All C# applications begin execution by calling the _____ method.
Correct : B. Main()
19. A _______ is an identifier that denotes a storage location
Correct : C. Variable
20. _________ are reserved, and cannot be used as identifiers.
Correct : A. Keywords
21. Boxing converts a value type on the stack to an ______ on the heap.
Correct : D. Object type
22. The character pair?: is an________________available in C#.
Correct : B. Ternary operator
23. In C#, all binary operators are ______.
Correct : C. Left-associative
24. An _______ is a symbol that tells the computer to perform certain mathematical or
logical manipulations.
Correct : A. Operator
25. A _____ is any valid C# variable ending with a colon.
Correct : B. Label
26. C# has _______ operator, useful for making two way decisions.
Correct : D. Conditional
27. ________causes the loop to continue with the next iteration after skipping any statements
in between.
Correct : D. Continue
28. An ____ is a group of contiguous or related data items that share a common name.
Correct : D. Array
29. Arrays in C# are ______ objects
Correct : A. Reference
30. Multidimensional arrays are sometimes called _______ Arrays.
Correct : C. Rectangular
31. Which of the following define the rules for .Net Languages?
Correct : B. CLS
32. ___________ namespace is not defined in the .NET class library.
Correct : A. System.CodeDom
33. Dot Net Framework consists of :
Correct : C. Common language runtime and set of class libraries
34. Which of the following statements are correct about JIT?
1. JIT compiler compiles instructions into machine code at run time.
2. The code compiler by the JIT compiler runs under CLR.
3. The instructions compiled by JIT compilers are written in native code.
4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.
Correct : A. 1,2,3
35. Which of the following is the root of the .NET type hierarchy?
Correct : D. System.Object
36. Code that targets the Common Language Runtime is known as
Correct : C. Managed Code
37. Which of the following statements correctly define .NET Framework?
Correct : A. It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web Services.
38. How many types of compilers availbale under CLR?
Correct : D. 3
39. Which of the following utilities can be used to compile managed assemblies into processor-specific native code?
Correct : B. ngen
40. Which of the following statements are correct about data types?
1. If the integer literal exceeds the range of byte, a compilation error will occur.
2. We cannot implicitly convert non-literal numeric types of larger storage size to byte.
3. Byte cannot be implicitly converted to float.
4. A char can be implicitly converted to only int data type. 5. We can cast the integral character codes.
Correct : D. 1,2,5
41. Which of the following is NOT an Integer?
Correct : A. Char
42. What will be the output of the following code snippet when it is executed?
int x = 1;
float y = 1.1f;
short z = 1;
Console.Write.Line((float) x + y * z - (x += (short) y));
Correct : A. 0.1
43. Which of the following is the correct size of a Decimal datatype?
Correct : D. None of the above
44. Which of the following statements are correct?
1. We can assign values of any type to variables of type object.
2. When a variable of a value type is converted to object, it is said to be unboxed.
3. When a variable of type object is converted to a value type, it is said to be boxed.
4. Boolean variable cannot have a value of null.
5. When a value type is boxed, an entirely new object must be allocated and constructed.
Correct : B. 1,5
45. Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be modified?
Correct : C. const float pi = 3.14F;
46. Which of the following can be used to terminate a while loop and transfer control outside the loop?
1. exit while
2. continue
3. exit statement
4. break
5. goto
Correct : D. 4,5
47. Which of the following statements are correct about the C#.NET
code snippet given below?
if (age > 18 && no < 11) a = 25;
1. The condition no < 11 will be evaluated only if age > 18 evaluates to True.
2. The statement a = 25 will get executed if any one condition is True.
3. The condition no < 11 will be evaluated only if age > 18 evaluates to False.
4. The statement a = 25 will get executed if both the conditions are True.
5. && is known as a short circuiting logical operator.
Correct : C. 1,4,5,
48. Which of the following is the correct output for the C#.NET code snippet given below?
Console.WriteLine(13 / 2 + " " + 13 % 2);
Correct : D. 6 1
49. Which of the following statements are correct?
1. Instance members of a class can be accessed only through an object of that class.
2. A class can contain only instance data and instance member function.
3. All objects created from a class will occupy equal number of bytes in memory.
4. A class can contain Friend functions.
5. A class is a blueprint or a template according to which objects are created.
Correct : A. 1,3,5
50. Which of the following is the correct way to create an object of the class Sample?
1. Sample s = new Sample();
2. Sample s;
3. Sample s; s = new Sample();
4. s = new Sample();
Correct : A. 1,3
51. Which of the following statements is correct about constructors?
Correct : D. If we do not provide a constructor, then the compiler provides a zero-argument constructor.
52. Which of the following statements is correct?
Correct : B. There is one common garbage collector for all programs.
53. Which of the following can be facilitated by the Inheritance mechanism?
1. Use the existing functionality of base class.
2. Overrride the existing functionality of base class.
3. Implement new functionality in the derived class.
4. Implement polymorphic behaviour.
5. Implement containership.
Correct : A. 1,2,3
54. Which one of the following statements is correct?
Correct : D. The default value of numeric array elements is zero.
55. Which of the following statements are correct about arrays used in C#.NET?
1. Arrays can be rectangular or jagged.
2. Rectangular arrays have similar rows stored in adjacent memory locations.
3. Jagged arrays do not have an access to the methods of System.Array Class.
4. Rectangular arrays do not have an access to the methods of System.Array Class.
5. Jagged arrays have dissimilar rows stored in non-adjacent memory locations.
Correct : D. 1,2,5
56. Which of the following statements are correct?
1. A struct can contain properties.
2. A struct can contain constructors.
3. A struct can contain protected data members.
4. A struct cannot contain methods.
5. A struct cannot contain constants.
Correct : A. 1,2
57. Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2; s2 = s1.Substring(12, 3);
Console.WriteLine(s2);
Correct : B. CRE
58. If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?
Correct : D. s1.Equals(s2)
59. Which of the following statements is correct about an Exception?
Correct : C. It occurs at run-time.
60. Which of the following statements are correct about exception handling in C#.NET?
1 If an exception occurs then the program terminates abruptly without getting any chance to recover from the exception. 2 No matter whether an exception occurs or not, the statements in the finally clause (if present) will get executed.
3 A program can contain multiple finally clauses.
4 A finally clause is written outside the try block.
5 Finally clause is used to perform cleanup operations like closing the network/database connections.
Correct : C. 2 and 5 only
61. ______ parameters are used to pass results back to the calling method.
Correct : D. Output
62. The formal-parameter-list is always enclosed in _______.
Correct : C. Parenthesis
63. _______ variables are visible only in the block they are declared.
Correct : C. Local
64. C# does not support _____ constructors.
Correct : B. parameter-less
65. A structure in C# provides a unique way of packing together data of ______ types.
Correct : A. Different
66. Struct’s data members are ____________ by default.
Correct : C. Private
67. A _______ creates an object by copying variables from another object.
Correct : A. Copy constructor
68. The methods that have the same name, but different parameter lists and different
definitions is called______.
Correct : A. Method Overloading
69. The C# provides special methods known as _____ methods to provide access to data members.
Correct : D. Accessor
70. Storage location used by computer memory to store data for usage by an application is ?
Correct : C. Variable
71. Which of these can be overloaded?
Correct : C. Both a & b
72. Number of constructors a class can define of ?
Correct : C. Any number
73. Correct statement about constructors in C#.NET is ?
Correct : D. Constructor have same name as name of the class
74. Constructors are used to
Correct : C. both a & b
75. To overload a method which of the following statement is false?
Correct : A. If the return type is different methods are overloaded
76. Which of the following statements is correct about constructors in C#.NET?
Correct : D. None of the mentioned
77. What is return type of constructors?
Correct : D. None of the mentioned
78. Which method have same name as that of its class?
Correct : C. constructor
79. Which of following statement are correct about functions?
Correct : A. C# allows a function to have arguments with default values
80. Which of the following statements are correct about an ArrayList collection that
implements the IEnumerable interface?
1. The ArrayList class contains an inner class that implements the IEnumerator interface.
2. An ArrayList Collection cannot be accessed simultaneously by different threads.
3. The inner class of ArrayList can access ArrayList class's members.
4. To access members of ArrayList from the inner class, it is necessary to pass ArrayList class's reference to it.
5. Enumerator's of ArrayList Collection can manipulate the array.
Correct : B. 1,3 and 4 only
81. How many enumerators will exist if four threads are simultaneously working on an ArrayList object?
Correct : D. 4
82. In which of the following collections is the Input/Output index-based? 1. Stack 2. Queue 3. BitArray 4. ArrayList 5. HashTable
Correct : B. 3 and 4 only
83. Which of the following statements are correct about the Stack collection?
1. It can be used for evaluation of expressions.
2. All elements in the Stack collection can be accessed using an enumerator.
3. It is used to maintain a FIFO list.
4. All elements stored in a Stack collection must be of similar type.
5. Top-most element of the Stack collection can be accessed using the Peek() method.
Correct : C. 1, 2 and 5 only
84. Which of the following is the correct way to access all elements of the Queue collection created using the C#.NET code snippet given below? Queue q = new Queue(); q.Enqueue("Sachin"); q.Enqueue('A'); q.Enqueue(false); q.Enqueue(38); q.Enqueue(5.4);
Correct : A. IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);
85. Which of the following statements is incorrect about delegate?
Correct : D. Only one method can be called using a delegate.
86. Which of the following statements are correct about the delegate declaration given below? delegate void del(int I);
1. On declaring the delegate a class called del will get created.
2. The signature of del need not be same as the signature of the method that we intend to call using it.
3. The del class will be derived from the MulticastDelegate class.
4. The method that can be called using del should not be a static method.
5. The del class will contain a one-argument constructor and an lnvoke() method.
Correct : B. 1, 3 and 5 only
87. 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 comparison function?
Correct : D. Delegate
88. What is a delegate?
Correct : A. A strongly typed function pointer.
89. Which of the following is included in Visual Studio IDE?
Correct : D. All of the above
90. Which of the following is true about dispose() method?
Correct : A. This method is protected.
91. Button class derives from
Correct : C. ButtonBase
92. Which namespace includes most of the Control classes for developing Windows applications?
Correct : C. System.Windows.Components.Forms
93. Which of the Control objects is viewed as a container that can hold other objects when
you design a Windows application?
Correct : D. Form
94. When an instance method declaration includes the abstract modifier, the method is said to
be an ______.
Correct : A. Abstract method
95. The theory of _____ implies that user can control the access to a class, method, or
variable.
Correct : B. Encapsulation
96. Inheritance is ______ in nature.
Correct : C. Transitive
97. The point at which an exception is thrown is called the _______.
Correct : D. Throw point
98. In C#, having unreachable code is always an _____.
Correct : C. Error
99. C# treats the multiple catch statements like cases in a _____________ statement.
Correct : B. Switch
100. C# supports a technique known as________, which allows a method to specify explicitly
the name of the interface it is implementing.