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
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/apply-interfaces-code/6-knowledge-check.yml
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Module assessment
4
4
metadata:
5
5
title: Module assessment
6
6
description: "Knowledge check"
7
-
ms.date: 02/17/2025
7
+
ms.date: 04/15/2025
8
8
author: wwlpublish
9
9
ms.author: eric
10
10
ms.topic: unit
@@ -16,15 +16,15 @@ quiz:
16
16
questions:
17
17
- content: "What is a key benefit of using default implementations in interfaces?"
18
18
choices:
19
-
- content: "They allow for code reuse across different implementations."
20
-
isCorrect: true
21
-
explanation: "Correct. Default implementations enable sharing common functions across different classes without copying code, promoting code reuse."
22
19
- content: "They automatically apply to all classes without any need for implementation."
23
20
isCorrect: false
24
21
explanation: "Incorrect. Classes must still implement the interface and can choose to use or override the default methods."
25
22
- content: "They prevent any changes to the interface once defined."
26
23
isCorrect: false
27
24
explanation: "Incorrect. Default implementations actually allow adding new methods to interfaces without breaking existing implementations."
25
+
- content: "They allow for code reuse across different implementations."
26
+
isCorrect: true
27
+
explanation: "Correct. Default implementations enable sharing common functions across different classes without copying code, promoting code reuse."
28
28
- content: "What is the purpose of the IDisposable interface in C#?"
29
29
choices:
30
30
- content: "To release unmanaged resources."
@@ -38,12 +38,12 @@ quiz:
38
38
explanation: "Incorrect. The IEnumerable interface is used for iterating over collections, not releasing unmanaged resources."
39
39
- content: "What is the main advantage of using system-defined interfaces like IEnumerable and IDisposable in C#?"
40
40
choices:
41
+
- content: "They prevent the need for any implementation in classes."
42
+
isCorrect: false
43
+
explanation: "Incorrect. Classes implementing system-defined interfaces must still provide implementations for the interface methods."
41
44
- content: "They provide standard methods that ensure consistent behavior across different types."
42
45
isCorrect: true
43
46
explanation: "Correct. System-defined interfaces provide standard methods that can be implemented across different types, ensuring uniformity and predictability in behavior."
44
47
- content: "They allow for the automatic generation of code."
45
48
isCorrect: false
46
-
explanation: "Incorrect. System-defined interfaces do not automatically generate code; they provide standard methods for consistent behavior."
47
-
- content: "They prevent the need for any implementation in classes."
48
-
isCorrect: false
49
-
explanation: "Incorrect. Classes implementing system-defined interfaces must still provide implementations for the interface methods."
49
+
explanation: "Incorrect. System-defined interfaces do not automatically generate code; they provide standard methods for consistent behavior."
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/apply-interfaces-code/index.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
### YamlMime:Module
2
2
uid: learn.wwl.apply-interfaces-code
3
3
metadata:
4
-
title: Apply interfaces in code
4
+
title: Apply Interfaces in Code
5
5
description: "Discover how default implementations in interfaces enable you to add new methods directly into an interface and provide a default implementation."
0 commit comments