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. |
A. | Only 1 and 2 |
B. | Only 1,2 and 4 |
C. | 1,2,3,4 |
D. | Only 4 and 5 |
Answer» 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 |
A. | 1,5 |
B. | 3,4 |
C. | 1,2 |
D. | 4,5 |
Answer» B. 3,4 |
3. | Which of the following statements is correct about Managed Code? |
A. | Managed code is the code that is compiled by the JIT compilers. |
B. | Managed code is the code where resources are Garbage Collected. |
C. | Managed code is the code that runs on top of Windows. |
D. | Managed code is the code that is written to target the services of the CLR. |
Answer» 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. |
A. | 1,2 |
B. | 2,4 |
C. | 4,5 |
D. | 1,2,4 |
Answer» 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? |
A. | NET class libraries |
B. | Common Language Runtime |
C. | Common Language Infrastructure |
D. | Component Object Model |
Answer» A. NET class libraries |
6. | 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 |
D. | Class Loader |
Answer» C. Garbage Collector |
7. | 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. |
D. | It is an environment for developing, building, deploying and executing Web Services. |
Answer» 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 |
A. | 1,2 |
B. | 2,3 |
C. | 3,4 |
D. | 2,5 |
Answer» B. 2,3 |
9. | Which of the following assemblies can be stored in Global Assembly Cache? |
A. | Private Assemblies |
B. | Friend Assemblies |
C. | Shared Assemblies |
D. | Public Assemblies |
Answer» C. Shared Assemblies |
10. | Code that targets the Common Language Runtime is known as |
A. | Unmanaged |
B. | Distributed |
C. | Legacy |
D. | Managed code |
Answer» D. Managed code |
11. | Which of the following statements is correct about the .NET Framework? |
A. | NET Framework uses DCOM for achieving language interoperability. |
B. | NET Framework is built on the DCOM technology. |
C. | NET Framework uses DCOM for making transition between managed and unmanaged code. |
D. | NET Framework uses DCOM for creating unmanaged applications. |
Answer» 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. |
A. | Only 1 and 2 |
B. | Only 2, 3 and 4 |
C. | Only 1, 3 and 4 |
D. | All of the above |
Answer» 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. |
A. | Only 1 and 2 |
B. | Only 3 and 4 |
C. | Only 1, 3 and 4 |
D. | All of the above |
Answer» 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. |
A. | 1,2,3 |
B. | 2,4,5 |
C. | 1,3,5 |
D. | 1,2 |
Answer» 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 |
A. | 1, 2, 3 |
B. | 2,4 |
C. | 3,4,5 |
D. | 1,2 |
Answer» 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 |
A. | Only 1, 2, 3 |
B. | Only 1, 2 |
C. | Only 1, 2, 4 |
D. | Only 4,5 |
Answer» B. Only 1, 2 |
17. | In C#, a subroutine is called a ________. |
A. | Function |
B. | Metadata |
C. | Method |
D. | Managed code |
Answer» C. Method |
18. | All C# applications begin execution by calling the _____ method. |
A. | Class() |
B. | Main() |
C. | Submain() |
D. | Namespace |
Answer» B. Main() |
19. | A _______ is an identifier that denotes a storage location |
A. | Constant |
B. | Reference type |
C. | Variable |
D. | Object |
Answer» C. Variable |
20. | _________ are reserved, and cannot be used as identifiers. |
A. | Keywords |
B. | literal |
C. | variables |
D. | Identifiers |
Answer» A. Keywords |
21. | Boxing converts a value type on the stack to an ______ on the heap. |
A. | Bool type |
B. | Instance type |
C. | Class type |
D. | Object type |
Answer» D. Object type |
22. | The character pair?: is an________________available in C#. |
A. | Unary operator |
B. | Ternary operator |
C. | Decision operator |
D. | Functional operator |
Answer» B. Ternary operator |
23. | In C#, all binary operators are ______. |
A. | Center-associative |
B. | Right-associative |
C. | Left-associative |
D. | Top-associative |
Answer» C. Left-associative |
24. | An _______ is a symbol that tells the computer to perform certain mathematical or logical manipulations. |
A. | Operator |
B. | Expression |
C. | Condition |
D. | Logic |
Answer» A. Operator |
26. | C# has _______ operator, useful for making two way decisions. |
A. | Looping |
B. | Functional |
C. | Exponential |
D. | Conditional |
Answer» D. Conditional |
27. | ________causes the loop to continue with the next iteration after skipping any statements in between. |
A. | Loop |
B. | Exit |
C. | Break |
D. | Continue |
Answer» D. Continue |
28. | An ____ is a group of contiguous or related data items that share a common name. |
A. | Operator |
B. | Integer |
C. | Exponential |
D. | Array |
Answer» D. Array |
29. | Arrays in C# are ______ objects |
A. | Reference |
B. | Logical |
C. | Value |
D. | Arithmetic |
Answer» A. Reference |
30. | Multidimensional arrays are sometimes called _______ Arrays. |
A. | Square |
B. | Triangular |
C. | Rectangular |
D. | Cube |
Answer» C. Rectangular |
31. | Which of the following define the rules for .Net Languages? |
A. | GAC |
B. | CLS |
C. | CTS |
D. | CLR |
Answer» B. CLS |
32. | ___________ namespace is not defined in the .NET class library. |
A. | System.CodeDom |
B. | System |
C. | System.IO |
D. | System.Text |
Answer» A. System.CodeDom |
33. | Dot Net Framework consists of : |
A. | Common language runtime |
B. | Set of class libraries |
C. | Common language runtime and set of class libraries |
D. | None of above |
Answer» 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. |
A. | 1,2,3 |
B. | 2,4 |
C. | 3,4 |
D. | 1,2 |
Answer» A. 1,2,3 |
35. | Which of the following is the root of the .NET type hierarchy? |
A. | System.Type |
B. | System.Base |
C. | System.Parent |
D. | System.Object |
Answer» D. System.Object |
36. | Code that targets the Common Language Runtime is known as |
A. | Unmanaged |
B. | Distributed |
C. | Managed Code |
D. | Native Code |
Answer» C. Managed Code |
37. | 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. |
D. | It is an environment for developing, building, deploying and executing Web Services. |
Answer» 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? |
A. | 4 |
B. | 2 |
C. | 1 |
D. | 3 |
Answer» D. 3 |
39. | Which of the following utilities can be used to compile managed assemblies into processor-specific native code? |
A. | gacutil |
B. | ngen |
C. | sn |
D. | ildasm |
Answer» B. ngen |
Chapter: Unit 2
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. |
A. | 1,3,5 |
B. | 2,4 |
C. | 3,5 |
D. | 1,2,5 |
Answer» D. 1,2,5 |
41. | Which of the following is NOT an Integer? |
A. | Char |
B. | Byte |
C. | Integer |
D. | Long |
Answer» 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)); |
A. | 0.1 |
B. | 1.0 |
C. | 1.1 |
D. | 11 |
Answer» A. 0.1 |
43. | Which of the following is the correct size of a Decimal datatype? |
A. | 8 bytes |
B. | 4 bytes |
C. | 10 bytes |
D. | None of the above |
Answer» 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. |
A. | 2,5 |
B. | 1,5 |
C. | 3,4 |
D. | 2,3 |
Answer» 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? |
A. | float pi = 3.14F; |
B. | #define pi 3.14F; |
C. | const float pi = 3.14F; |
D. | const float pi; pi = 3.14F; |
Answer» 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 |
A. | 1,3 |
B. | 2,4 |
C. | 3,5 |
D. | 4,5 |
Answer» 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. |
A. | 1,3 |
B. | 2,5 |
C. | 1,4,5, |
D. | 3,4,5 |
Answer» 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); |
A. | 6.5 1 |
B. | 6.5 0 |
C. | 6 0 |
D. | 6 1 |
Answer» 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. |
A. | 1,3,5 |
B. | 2,4 |
C. | 3,5 |
D. | 2,4,5 |
Answer» A. 1,3,5 |
51. | Which of the following statements is correct about constructors? |
A. | If we provide a one-argument constructor then the compiler still provides a zeroargument constructor. |
B. | Overloaded constructors have the same name as the class name |
C. | Overloaded constructors cannot use optional arguments. |
D. | If we do not provide a constructor, then the compiler provides a zero-argument constructor. |
Answer» D. If we do not provide a constructor, then the compiler provides a zero-argument constructor. |
52. | 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. |
D. | We have to specifically run the garbage collector after executing Visual Studio.NET. |
Answer» 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. |
A. | 1,2,3 |
B. | 3,4 |
C. | 2,4,5 |
D. | 3,5 |
Answer» A. 1,2,3 |
54. | Which one of the following statements is correct? |
A. | Array elements can be of integer type only. |
B. | The rank of an Array is the total number of elements it can contain. |
C. | The length of an Array is the number of dimensions in the Array. |
D. | The default value of numeric array elements is zero. |
Answer» 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. |
A. | 1,2 |
B. | 1,3,5 |
C. | 3,4 |
D. | 1,2,5 |
Answer» 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. |
A. | 1,2 |
B. | 3,4 |
C. | 1,2,4 |
D. | 3,5 |
Answer» 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); |
A. | ARE |
B. | CRE |
C. | CR |
D. | REA |
Answer» 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? |
A. | s1 is s2 |
B. | s1=s2 |
C. | s1==s2 |
D. | s1.Equals(s2) |
Answer» D. s1.Equals(s2) |
59. | Which of the following statements is correct about an Exception? |
A. | It occurs during compilation. |
B. | It occurs during linking. |
C. | It occurs at run-time. |
D. | It occurs during Just-In-Time compilation. |
Answer» 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. |
A. | 1 only |
B. | 2 only |
C. | 2 and 5 only |
D. | 3 and 4 only |
Answer» C. 2 and 5 only |
61. | ______ parameters are used to pass results back to the calling method. |
A. | Input |
B. | Reference |
C. | Value |
D. | Output |
Answer» D. Output |
62. | The formal-parameter-list is always enclosed in _______. |
A. | Square |
B. | Semicolon |
C. | Parenthesis |
D. | Colon |
Answer» C. Parenthesis |
63. | _______ variables are visible only in the block they are declared. |
A. | System |
B. | Global |
C. | Local |
D. | Console |
Answer» C. Local |
64. | C# does not support _____ constructors. |
A. | parameterized |
B. | parameter-less |
C. | Class |
D. | Method |
Answer» B. parameter-less |
65. | A structure in C# provides a unique way of packing together data of ______ types. |
A. | Different |
B. | Same |
C. | Invoking |
D. | Calling |
Answer» A. Different |
66. | Struct’s data members are ____________ by default. |
A. | Protected |
B. | Public |
C. | Private |
D. | Default |
Answer» C. Private |
67. | A _______ creates an object by copying variables from another object. |
A. | Copy constructor |
B. | Default constructor |
C. | Invoking constructor |
D. | Calling constructor |
Answer» A. Copy constructor |
68. | The methods that have the same name, but different parameter lists and different definitions is called______. |
A. | Method Overloading |
B. | Method Overriding |
C. | Method Overwriting |
D. | Method Overreading |
Answer» A. Method Overloading |
69. | The C# provides special methods known as _____ methods to provide access to data members. |
A. | Loop |
B. | Functions |
C. | Methods |
D. | Accessor |
Answer» D. Accessor |
70. | Storage location used by computer memory to store data for usage by an application is ? |
A. | Pointers |
B. | Constants |
C. | Variable |
D. | None of the mentioned |
Answer» C. Variable |
71. | Which of these can be overloaded? |
A. | Constructors |
B. | Methods |
C. | Both a & b |
D. | None of the mentioned |
Answer» C. Both a & b |
72. | Number of constructors a class can define of ? |
A. | 1 |
B. | 2 |
C. | Any number |
D. | None of the mentioned |
Answer» C. Any number |
73. | Correct statement about constructors in C#.NET is ? |
A. | Constructor cannot be overloaded |
B. | Constructor allocate space for object in memory |
C. | Constructor are never called explicitly |
D. | Constructor have same name as name of the class |
Answer» D. Constructor have same name as name of the class |
74. | Constructors are used to |
A. | initialize the objects |
B. | construct the data members |
C. | both a & b |
D. | None of the mentioned |
Answer» C. both a & b |
76. | 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 |
D. | None of the mentioned |
Answer» D. None of the mentioned |
77. | What is return type of constructors? |
A. | int |
B. | float |
C. | void |
D. | None of the mentioned |
Answer» D. None of the mentioned |
78. | Which method have same name as that of its class? |
A. | delete |
B. | class |
C. | constructor |
D. | None of mentioned |
Answer» C. constructor |
79. | Which of following statement are correct about functions? |
A. | C# allows a function to have arguments with default values |
B. | Redefining a method parameter in the method’s body causes an exception |
C. | C# allows function to have arguments of private type |
D. | Omitting the return type in method definition results into exception |
Answer» A. C# allows a function to have arguments with default values |
Chapter: Unit 3
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. |
A. | 1 and 2 only |
B. | 1,3 and 4 only |
C. | 2 and 5 only |
D. | None of the above |
Answer» B. 1,3 and 4 only |
81. | How many enumerators will exist if four threads are simultaneously working on an ArrayList object? |
A. | 1 |
B. | 3 |
C. | 2 |
D. | 4 |
Answer» 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 |
A. | 1 and 2 only |
B. | 3 and 4 only |
C. | 5 only |
D. | 1, 2 and 5 only |
Answer» 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. |
A. | 1 and 2 only |
B. | 3 and 4 only |
C. | 1, 2 and 5 only |
D. | All of the above |
Answer» 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); |
A. | IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current); |
B. | IEnumerable e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current); |
C. | IEnumerator e; e = q.GetEnumerable(); while (e.MoveNext()) Console.WriteLine(e.Current); |
D. | IEnumerator e; e = Queue.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current); |
Answer» A. IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current); |
85. | Which of the following statements is incorrect about delegate? |
A. | Delegates are reference types. |
B. | Delegates are object oriented. |
C. | Delegates are type-safe. |
D. | Only one method can be called using a delegate. |
Answer» 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. |
A. | 1, 2 and 3 only |
B. | 1, 3 and 5 only |
C. | 2 and 4 only |
D. | 4 only |
Answer» 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? |
A. | Namespace |
B. | Interface |
C. | Encapsulation |
D. | Delegate |
Answer» D. Delegate |
88. | What is a delegate? |
A. | A strongly typed function pointer. |
B. | A light weight thread or process that can call a single method. |
C. | A reference to an object in a different process. |
D. | An inter-process message channel. |
Answer» A. A strongly typed function pointer. |
89. | Which of the following is included in Visual Studio IDE? |
A. | Form Designer |
B. | Code Editor |
C. | Solution Explorer |
D. | All of the above |
Answer» D. All of the above |
90. | Which of the following is true about dispose() method? |
A. | This method is protected. |
B. | Its return type is int. |
C. | It accepts a float parameter. |
D. | All of the above. |
Answer» A. This method is protected. |
91. | Button class derives from |
A. | Checkbox |
B. | RadioButton |
C. | ButtonBase |
D. | None of the above |
Answer» C. ButtonBase |
92. | Which namespace includes most of the Control classes for developing Windows applications? |
A. | System; |
B. | System.Windows.Controls |
C. | System.Windows.Components.Forms |
D. | System.Windows.Forms |
Answer» 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? |
A. | Control |
B. | Button |
C. | Window |
D. | Form |
Answer» D. Form |
94. | When an instance method declaration includes the abstract modifier, the method is said to be an ______. |
A. | Abstract method |
B. | Instance method |
C. | Sealed method |
D. | Expression method |
Answer» A. Abstract method |
95. | The theory of _____ implies that user can control the access to a class, method, or variable. |
A. | Data hiding |
B. | Encapsulation |
C. | Information Hiding |
D. | Polymorphism |
Answer» B. Encapsulation |
96. | Inheritance is ______ in nature. |
A. | Commutative |
B. | Associative |
C. | Transitive |
D. | Iterative |
Answer» C. Transitive |
97. | The point at which an exception is thrown is called the _______. |
A. | Default point |
B. | Invoking point |
C. | Calling point |
D. | Throw point |
Answer» D. Throw point |
98. | In C#, having unreachable code is always an _____. |
A. | Method |
B. | Function |
C. | Error |
D. | Iterative |
Answer» C. Error |
99. | C# treats the multiple catch statements like cases in a _____________ statement. |
A. | If |
B. | Switch |
C. | For |
D. | While |
Answer» B. Switch |
101. | The reason that C# does not support multiple inheritances is because of ______. | |
A. | Method collision | |
B. | Name collision | |
C. | Function collision | |
D. | Interface collision | |
Answer» B. Name collision | ||
102. | _______ is a set of devices through which a user communicates with a system using interactive set of commands. |
A. | Console |
B. | System |
C. | Keyboard |
D. | Monitor |
Answer» A. Console |
103. | Exponential formatting character (‘E’ or ‘e’) converts a given value to string in the form of _______. |
A. | m.dddd |
B. | E+xxx |
C. | m.dddd |
D. | E+xxx |
Answer» A. m.dddd |
104. | The ______ are the Graphical User Interface (GUI) components created for web based interactions.. |
A. | Web forms |
B. | Window Forms |
C. | Application Forms |
D. | None of the above |
Answer» B. Window Forms |
105. | In Microsoft Visual Studio, ______ technology and a programming language such as C# is used to create a Web based application. |
A. | JAVA |
B. | J# |
C. | VB.NET |
D. | ASP.NET |
Answer» D. ASP.NET |
106. | The controls available in the tool box of the ______ are used to create the user interface of a web based application. |
A. | Microsoft visual studio IDE |
B. | Application window |
C. | Web forms |
D. | None of the above |
Answer» A. Microsoft visual studio IDE |
107. | Web Forms consists of a _______ and a _________ . |
A. | Template, Component |
B. | CLR, CTS |
C. | HTML Forms, Web services |
D. | Windows, desktop |
Answer» A. Template, Component |
108. | The ______ parentheses that follow _____ indicate that no information is passed to Main(). |
A. | Empty, class |
B. | Empty, submain |
C. | Empty, Main |
D. | Empty, Namespace |
Answer» C. Empty, Main |
109. | The scope of a variable depends on the ____________ and _________. |
A. | Main method, place of its declaration |
B. | Type of the variable, console |
C. | compiler, main |
D. | Type of the variable, place of its declaration |
Answer» B. Type of the variable, console |
110. | Which of the following statements is correct about the C#.NET code snippet given below? class Student s1, s2; // Here ‘Student’ is a user-defined class. s1 = new Student(); s2 = new Student(); |
A. | Contents of s1 and s2 will be exactly same. |
B. | The two objects will get created on the stack. |
C. | Contents of the two objects created will be exactly same. |
D. | The two objects will always be created in adjacent memory locations. |
Answer» C. Contents of the two objects created will be exactly same. |
111. | 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. |
A. | 1, 2, 3 |
B. | 3, 4 |
C. | 2, 4, 5 |
D. | 3, 5 |
Answer» A. 1, 2, 3 |
112. | Which of the following should be used to implement a ‘Has a’ relationship between two entities? |
A. | Polymorphism |
B. | Templates |
C. | Containership |
D. | Encapsulation |
Answer» C. Containership |
113. | Which of the following should be used to implement a ‘Like a’ or a ‘Kind of’ relationship between two entities? |
A. | Polymorphism |
B. | Containership |
C. | Templates |
D. | Inheritance |
Answer» D. Inheritance |
114. | 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 seal |
Answer» C. Declare the class as seal |
115. | 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. | 0 byte |
D. | 8 bytes |
Answer» B. 24 bytes |
116. | 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. |
D. | Interfaces can contain only method declaration. |
Answer» B. Interfaces can be inherited. |
117. | Which of the following statements is correct about an interface used in C#.NET? |
A. | If a class implements an interface partially, then it should be an abstract class. |
B. | Class cannot implement an interface partially. |
C. | An interface can contain static methods. |
D. | An interface can contain static data. |
Answer» A. If a class implements an interface partially, then it should be an abstract class. |
118. | 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. |
D. | The functions declared in an interface have a body. |
Answer» C. A class that implements an interface can explicitly implement members of that interface. |
Chapter: Unit 4
119. | Databases store information in records, fields and: |
A. | data providers |
B. | grids |
C. | columns |
D. | tables |
Answer» D. tables |
120. | Each data provider class is grouped and accessible through its: |
A. | namespace |
B. | database |
C. | datagrid |
D. | provider |
Answer» A. namespace |
121. | In Visual Studio, the tool that enables you to connect to a database and automatically populate a dataset object using a TableAdapter object is the ___________wizard: |
A. | Data Source Configuration |
B. | Data Source |
C. | Query Builder |
D. | DataSet Designer |
Answer» A. Data Source Configuration |
122. | In XML, a document is a hierarchy of |
A. | attributes |
B. | elements |
C. | tags |
D. | All of the above |
Answer» B. elements |
123. | Which of the following namespace contains the LINQ to XML? |
A. | System.Xml; |
B. | System.Data; |
C. | System.Xml.Linq; |
D. | System.Linq; |
Answer» C. System.Xml.Linq; |
124. | LINQ to SQL works with |
A. | SQL Server |
B. | SQL Server Compact 3.5 |
C. | Both (a) and (b) |
D. | None of the above |
Answer» C. Both (a) and (b) |
126. | To avoid writing additional SQL statements to update a live database, you instantiate an object of which class? | |
A. | DataAdapter | |
B. | DataReader | |
C. | DataSet | |
D. | CommandBuilder | |
Answer» A. DataAdapter | ||
127. | The following namespaces (System.Data.OleDB, System.Data.SqlClient, System.Data.Odbc, System.Data.OracleClient) include classes for different: |
A. | Data providers |
B. | File streams |
C. | ADO.NET applications |
D. | Databases |
Answer» A. Data providers |
128. | Which of the following is a definition of a database? |
A. | It is a collection of related information organized on a computer. |
B. | It is single flat file. |
C. | It is a file that can only be set up on a single PC. |
D. | It is a group of files that can be set up only on a network. |
Answer» A. It is a collection of related information organized on a computer. |
129. | A computer application for managing databases and pulling together data to generate reports and make decisions is known as a(n) |
A. | Database System (DS). |
B. | File Manager (FM). |
C. | Management System (MS). |
D. | Database Management System (DBMS). |
Answer» D. Database Management System (DBMS). |
130. | Which of the following characterizes the relational model for databases? |
A. | It organizes data into a hierarchal format. |
B. | It splits data into separate row and column areas called tables. |
C. | It organizes data into one large table. |
D. | It organizes data into a network format. |
Answer» B. It splits data into separate row and column areas called tables. |
131. | A field is a |
A. | group of records. |
B. | index that locates information in a table. |
C. | common characteristic in a table of information. |
D. | code that represents a record. |
Answer» C. common characteristic in a table of information. |
132. | Forms and reports, used for entering and editing records, and for generating useful information in reports are |
A. | additional database objects. |
B. | only useful for complex databases. |
C. | difficult to generate. |
D. | stored separately from databases. |
Answer» D. stored separately from databases. |
133. | A computer application that manages a database, in which different kinds of data are stored in separate tables, is known as a |
A. | Normal database system. |
B. | Network database system. |
C. | Standalone database system. |
D. | Relational database management system. |
Answer» D. Relational database management system. |
134. | Which of the following are examples of relational database management systems? |
A. | Adobe Publisher and Autocad |
B. | Delphi and Turbo C++ |
C. | Microsoft Excel and Microsoft Project |
D. | Microsoft Access and SQL 2000 |
Answer» D. Microsoft Access and SQL 2000 |
135. | A unique field which distinguishs a record is known as a |
A. | Foreign key. |
B. | Primary key. |
C. | Tertiary key. |
D. | Secondary key. |
Answer» D. Secondary key. |
136. | In a database, a parent-child relationship is also known as a |
A. | Many-to-one relationship. |
B. | Many-to-many relationship. |
C. | One-to-many relationship. |
D. | One-to-one relationship. |
Answer» C. One-to-many relationship. |
137. | The field in the child table that links information to the parent table is known as the |
A. | Foreign key. |
B. | Primary key. |
C. | Tertiary key. |
D. | Secondary key. |
Answer» A. Foreign key. |
138. | ADO.NET is the data access component of Microsoft’s .NET framework that enables you to |
A. | connect your Visual Basic.NET applications to your company’s local area network. |
B. | connect your Visual Basic.NET applications to databases. |
C. | connect your PC to the Internet. |
D. | connect your local area network to the Internet. |
Answer» B. connect your Visual Basic.NET applications to databases. |
139. | ADO.NET was created for |
A. | Multiple users. |
B. | Single users. |
C. | Home network users. |
D. | Limited users. |
Answer» A. Multiple users. |
140. | Which of the following statements characterizes the relationship between a Visual Basic.NET program and a database record? |
A. | They are connected. |
B. | External databases cannot be accessed by Visual Basic.NET. |
C. | They are connected as long as the program is running. |
D. | They are not connected. |
Answer» C. They are connected as long as the program is running. |
141. | A copy of a database is called a |
A. | Duplicate database. |
B. | Dataset. |
C. | Table. |
D. | Database copy. |
Answer» B. Dataset. |
142. | When is the dataset connected to the database? |
A. | Whenever the program makes changes to a field or record |
B. | They are always connected |
C. | They are always disconnected |
D. | Whenever the program is running |
Answer» A. Whenever the program makes changes to a field or record |
143. | The connection to the database is established by |
A. | Using a local area network. |
B. | Installing a special software package. |
C. | Using managed providers. |
D. | Using a wide area network. |
Answer» C. Using managed providers. |
144. | The ADO.NET disconnected dataset |
A. | Provides a flexible way of working with database records. |
B. | Makes working with databases very complex. |
C. | Requires a large amount of memory space. |
D. | Is required when single users want to access a database. |
Answer» A. Provides a flexible way of working with database records. |
145. | XML provides a(n) |
A. | Difficult format for data storage. |
B. | Numeric based code for data storage. |
C. | Consistent format for data across applications, networks, and the Internet. |
D. | Limited format for data storage. |
Answer» C. Consistent format for data across applications, networks, and the Internet. |
146. | Why does Visual Studio.NET use XML as a data storage technology? |
A. | XML works best for the single PC user. |
B. | XML restricts the number of applications that can interface with Visual Basic.NET. |
C. | XML is optimized for sharing data across the Internet. |
D. | XML is easier to understand than Visual Basic.NET. |
Answer» C. XML is optimized for sharing data across the Internet. |
147. | Choose the correct statements about the LINQ? |
A. | The main concept behind the linq is query |
B. | linq make use of for loop to execute the query |
C. | It is not required that linq should make use of IEnumerable interface |
D. | None of the mentioned |
Answer» A. The main concept behind the linq is query |
148. | Choose the namespace in which the interface IEnumerable is declared? |
A. | System.Collections |
B. | System.Collections.Generic |
C. | Both a & b |
D. | None of the mentioned |
Answer» A. System.Collections |
149. | Can we use linq to query against a DataTable? |
A. | Yes |
B. | No |
C. | Situational |
D. | None of the mentioned |
Answer» A. Yes |
151. | What is meant by the term generics? |
A. | parameterized types |
B. | class |
C. | structure |
D. | interface |
Answer» A. parameterized types |
152. | Are generics in C# are same as the generics in java and templates in C++? |
A. | Yes |
B. | No |
C. | May be |
D. | None of the mentioned |
Answer» A. Yes |
153. | Choose the advantages of using generics? |
A. | Generics facilitate type safety |
B. | Generics facilitate improved performance and reduced code |
C. | Generics promote the usage of parameterized types |
D. | All of the mentioned |
Answer» D. All of the mentioned |
154. | Which among the given classes present in System.Collection.Generic.namespace? |
A. | Stack |
B. | Tree |
C. | Sorted Array |
D. | All of the mentioned |
Answer» A. Stack |
155. | Which feature enables to obtain information about use and capabilities of types at runtime? |
A. | Runtime type ID |
B. | Reflection |
C. | Attributes |
D. | None of the mentioned |
Answer» B. Reflection |
156. | Choose the namespace which consists of classes that are part of .NET Reflection API: |
A. | System.Text |
B. | System.Name |
C. | System.Reflection |
D. | None of the mentioned |
Answer» C. System.Reflection |
Tags
Question and answers in C# Programming,C# Programming multiple choice questions and answers,C# Programming Important MCQs,Solved MCQs for C# Programming,C# Programming MCQs with answers PDF download