You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- content: "What is the main difference between structured programming and object-oriented programming?"
16
+
choices:
17
+
- content: "Structured programming and object-oriented programming are essentially the same, with only minor differences in syntax and terminology."
18
+
isCorrect: false
19
+
explanation: "Incorrect. Structured programming and object-oriented programming are two distinct approaches to software development, each with its own set of principles and methodologies."
20
+
- content: "Structured programming focuses on the sequence of actions to be performed, while object-oriented programming emphasizes the objects involved in the actions."
21
+
isCorrect: true
22
+
explanation: "Correct. While structured programming focuses on the sequence of actions to be performed, object-oriented programming emphasizes the objects involved in the actions."
23
+
- content: "Structured programming is based on objects that encapsulate both data and behavior, while object-oriented programming is based on a top-down approach where the program is divided into smaller, manageable functions or procedures."
24
+
isCorrect: false
25
+
explanation: "Incorrect. This statement is reversed. Object-oriented programming is based on objects that encapsulate both data and behavior, while structured programming is based on a top-down approach where the program is divided into smaller, manageable functions or procedures."
26
+
- content: "What is the main difference between a static class and a non-static class?"
27
+
choices:
28
+
- content: "A static class can't be instantiated and it contains only static members."
29
+
isCorrect: true
30
+
explanation: "Correct. A static class is essentially a non-static class that can't be instantiated and only contains static members."
31
+
- content: "A static class can't contain static methods, fields, properties, or events."
32
+
isCorrect: false
33
+
explanation: "Incorrect. A static class can only contain static members."
34
+
- content: "A static class can be instantiated using the 'new' operator."
35
+
isCorrect: false
36
+
explanation: "Incorrect. A static class can't be instantiated using the 'new' operator."
37
+
- content: "What is the purpose of using the partial keyword in class definitions?"
38
+
choices:
39
+
- content: "It allows a class to inherit from multiple base classes."
40
+
isCorrect: false
41
+
explanation: "Incorrect. In C#, a class can't inherit from multiple base classes. The partial keyword is used to split a class definition across multiple files."
42
+
- content: "It enables the splitting of a class definition over two or more source files."
43
+
isCorrect: true
44
+
explanation: "Correct. The partial keyword allows a class definition to be split across multiple files. All parts are combined when the application is compiled."
45
+
- content: "It makes a class abstract, meaning it can't be instantiated directly."
46
+
isCorrect: false
47
+
explanation: "Incorrect. The partial keyword does not make a class abstract. It's used to split a class definition across multiple files."
48
+
- content: "What happens when named and optional arguments are used in a method?"
49
+
choices:
50
+
- content: "The arguments are evaluated in the order in which they appear in the parameter list, not the argument list."
51
+
isCorrect: false
52
+
explanation: "Incorrect. When named and optional arguments are used, the arguments are evaluated in the order in which they appear in the argument list, not the parameter list."
53
+
- content: "The arguments are evaluated in the order in which they appear in the argument list, not the parameter list, and they allow supplying arguments for selected parameters."
54
+
isCorrect: true
55
+
explanation: "Correct. Named and optional arguments are evaluated in the order they appear in the argument list and they allow supplying arguments for selected parameters."
56
+
- content: "Named and optional parameters do not allow supplying arguments for selected parameters."
57
+
isCorrect: false
58
+
explanation: "Incorrect. Named and optional parameters enable you to supply arguments for selected parameters."
59
+
- content: "What is the purpose of a copy constructor in C#?"
60
+
choices:
61
+
- content: "It allows you to create a new object by copying the values of an existing object's methods."
62
+
isCorrect: false
63
+
explanation: "Incorrect. A copy constructor does not copy the methods of an existing object, it copies the values of an existing object's properties."
64
+
- content: "It allows you to create a new object by copying the values of an existing object's properties."
65
+
isCorrect: true
66
+
explanation: "Correct. A copy constructor in C# creates a new object by copying the values of an existing object's properties."
67
+
- content: "It allows you to assign values to any accessible fields or properties of an object at creation time without having to invoke a constructor followed by lines of assignment statements."
68
+
isCorrect: false
69
+
explanation: "Incorrect. This is the definition of an object initializer, not a copy constructor."
70
+
- content: "What is the role of a finalizer in a class in C#?"
71
+
choices:
72
+
- content: "Finalizers are used to allocate memory for a class instance."
73
+
isCorrect: false
74
+
explanation: "Incorrect. Finalizers aren't used for memory allocation, but for clean-up when a class instance is being collected by the garbage collector."
75
+
- content: "Finalizers are used to perform any necessary final clean-up when a class instance is being collected by the garbage collector."
76
+
isCorrect: true
77
+
explanation: "Correct. Finalizers are used to release any unmanaged resources and perform clean-up before an object is garbage collected."
78
+
- content: "Finalizers can be called explicitly to perform specific actions."
79
+
isCorrect: false
80
+
explanation: "Incorrect. Finalizers can't be called explicitly. They're invoked automatically by the garbage collector."
81
+
- content: "What is the primary purpose of implementing classes in C# applications?"
82
+
choices:
83
+
- content: "To increase the execution speed of the application"
84
+
isCorrect: false
85
+
explanation: "Incorrect. While efficient code can improve execution speed, the primary purpose of classes is to encapsulate data and behavior."
86
+
- content: "To create a visual representation of the application"
87
+
isCorrect: false
88
+
explanation: "Incorrect. Classes aren't used for visual representation, they're used to define objects and their behavior."
89
+
- content: "To encapsulate data and behavior into objects"
90
+
isCorrect: true
91
+
explanation: "Correct. Classes in C# are used to encapsulate data and behavior into objects, providing a blueprint for creating instances or objects."
0 commit comments