1. | 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 |
2. | 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 |
3. | 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 |
4. | 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 |
5. | 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); |
6. | 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. |
7. | 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 |
8. | 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 |
9. | 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. |
10. | 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 |
11. | 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. |
12. | Button class derives from |
A. | Checkbox |
B. | RadioButton |
C. | ButtonBase |
D. | None of the above |
Answer» C. ButtonBase |
13. | 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 |
14. | 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 |
15. | 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 |
16. | 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 |
17. | Inheritance is ______ in nature. |
A. | Commutative |
B. | Associative |
C. | Transitive |
D. | Iterative |
Answer» C. Transitive |
18. | 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 |
19. | In C#, having unreachable code is always an _____. |
A. | Method |
B. | Function |
C. | Error |
D. | Iterative |
Answer» C. Error |
20. | C# treats the multiple catch statements like cases in a _____________ statement. |
A. | If |
B. | Switch |
C. | For |
D. | While |
Answer» B. Switch |
21. | C# supports a technique known as________, which allows a method to specify explicitly the name of the interface it is implementing. |
A. | Method Implementation |
B. | Implicit Interface Implementation |
C. | Explicit Interface Implementation |
D. | Iterative Interface Implementation |
Answer» C. Explicit Interface Implementation |
22. | 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 |
23. | _______ 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 |
24. | 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 |
26. | 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 |
27. | 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 |
28. | 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 |
29. | 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 |
30. | 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 |
31. | 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. |
32. | 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 |
33. | 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 |
34. | 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 |
35. | 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 |
36. | 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 |
37. | 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. |
38. | 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. |
39. | 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. |
Question and answers in Unit 3,Unit 3 Multiple choice questions and answers,Unit 3 Important MCQs,Solved MCQs for Unit 3,Unit 3 MCQs with answers PDF download