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: "A property refers to the connectivity between two objects."
18
+
isCorrect: false
19
+
explanation: "Incorrect. A property does not refer to the connectivity between two objects."
20
+
- content: "It's a piece of land or real estate."
21
+
isCorrect: false
22
+
explanation: "Incorrect. While the noun property can be defined this way, it isn't how the term is used in computer programming."
23
+
- content: "A property is a class member that provides a mechanism to read, write, or compute the values of a field."
24
+
isCorrect: true
25
+
explanation: "Correct. A property allows for the getting, setting, and computing the values of a field."
26
+
- content: "How are return values returned from a method?"
27
+
choices:
28
+
- content: "With a goto statement."
29
+
isCorrect: false
30
+
explanation: "Incorrect. A goto statement doesn't exist in C#."
31
+
- content: "With a using statement."
32
+
isCorrect: false
33
+
explanation: "Incorrect. Using statements aren't used for returning a value from a method."
34
+
- content: "With a return statement."
35
+
isCorrect: true
36
+
explanation: "Correct. You use a return statement to return a value from a method."
37
+
- content: "What is the purpose of the 'get' accessor in a class property?"
38
+
choices:
39
+
- content: "It assigns a value to the property."
40
+
isCorrect: false
41
+
explanation: "Incorrect. The 'get' accessor does not assign a value to the property, it retrieves the value of the property."
42
+
- content: "It validates data before allowing a change."
43
+
isCorrect: false
44
+
explanation: "Incorrect. While properties can be used to validate data, this isn't the specific role of the 'get' accessor. The 'get' accessor is used to retrieve the value of the property."
45
+
- content: "It retrieves the value of the property."
46
+
isCorrect: true
47
+
explanation: "Correct. The 'get' accessor is used to retrieve the value of the property."
48
+
- content: "What is the purpose of automatically implemented properties in C#?"
49
+
choices:
50
+
- content: "They allow direct access to private fields of a class."
51
+
isCorrect: false
52
+
explanation: "Incorrect. Automatically implemented properties do not allow direct access to private fields. They create a private, anonymous backing field that can only be accessed through the property's `get` and `set` accessors."
53
+
- content: "They make property-declaration more concise when no other logic is required in the property accessors."
54
+
isCorrect: true
55
+
explanation: "Correct. Automatically implemented properties simplify the declaration of properties when no other logic is needed in the `get` and `set` accessors."
56
+
- content: "They enable the creation of mutable classes only."
57
+
isCorrect: false
58
+
explanation: "Incorrect. Automatically implemented properties can be used in both mutable and immutable classes. The mutability depends on how the accessors are defined."
59
+
- content: "What is the purpose of using access modifiers in a class?"
60
+
choices:
61
+
- content: "To specify how accessible each of its members is to code outside of the class and limit the potential for coding errors or malicious exploits."
62
+
isCorrect: true
63
+
explanation: "Correct. Access modifiers are used to specify the accessibility of class members and to limit the potential for coding errors or malicious exploits."
64
+
- content: "To make all methods and properties accessible only by code in the same class or a derived class."
65
+
isCorrect: false
66
+
explanation: "Incorrect. Not all methods and properties are meant to be accessed only by code in the same class or a derived class. Some are meant to be accessed from outside the class."
67
+
- content: "To allow all methods and variables to be accessed from outside of the class or assembly."
68
+
isCorrect: false
69
+
explanation: "Incorrect. Access modifiers are used to limit the accessibility of methods and variables, not to allow all of them to be accessed from outside."
70
+
- content: "What is the priority of extension methods compared to instance methods during compile time?"
71
+
choices:
72
+
- content: "Instance methods have higher priority than extension methods."
73
+
isCorrect: true
74
+
explanation: "Correct. If a type has an instance method and an extension method with the same signature, the compiler will bind to the instance method."
75
+
- content: "Extension methods and instance methods have equal priority."
76
+
isCorrect: false
77
+
explanation: "Incorrect. Instance methods are prioritized over extension methods during compile time."
78
+
- content: "Extension methods have higher priority than instance methods."
79
+
isCorrect: false
80
+
explanation: "Incorrect. During compile time, instance methods always have higher priority than extension methods."
0 commit comments