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/implement-class-inheritance/8-knowledge-check.yml
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -4,58 +4,58 @@ title: Knowledge check
4
4
metadata:
5
5
title: Knowledge check
6
6
description: "Knowledge check"
7
-
ms.date: 03/04/2025
7
+
ms.date: 03/05/2025
8
8
author: wwlpublish
9
9
ms.author: cahowd
10
10
ms.topic: unit
11
11
durationInMinutes: 3
12
12
quiz:
13
13
title: "Check your knowledge"
14
14
questions:
15
-
- content: "What does the colon (:) character indicate in the declaration of a derived class in C#?"
15
+
- content: "What does the colon (`:`) character indicate in the declaration of a derived class in C#?"
16
16
choices:
17
17
- content: "It indicates that the derived class is implementing an interface."
18
18
isCorrect: false
19
-
explanation: "Incorrect. The colon (:) character in C# is used to indicate inheritance, not interface implementation."
19
+
explanation: "Incorrect. The colon (`:`) character in C# is used to indicate inheritance, not interface implementation."
20
20
- content: "It indicates that the derived class is defining a new property or method."
21
21
isCorrect: false
22
-
explanation: "Incorrect. The colon (:) character in C# is used to indicate inheritance, not the definition of new properties or methods."
22
+
explanation: "Incorrect. The colon (`:`) character in C# is used to indicate inheritance, not the definition of new properties or methods."
23
23
- content: "It indicates that the derived class is inheriting from a base class."
24
24
isCorrect: true
25
-
explanation: "Correct. In C#, the colon (:) character is used in the declaration of a derived class to indicate that it's inheriting from a base class."
26
-
- content: "What is the effect of the 'sealed' keyword in C# inheritance?"
25
+
explanation: "Correct. In C#, the colon (`:`) character is used in the declaration of a derived class to indicate that it's inheriting from a base class."
26
+
- content: "What is the effect of the `sealed` keyword in C# inheritance?"
27
27
choices:
28
28
- content: "It allows a method to be overridden in derived classes."
29
29
isCorrect: false
30
-
explanation: "Incorrect. The 'sealed' keyword prevents a method from being overridden in derived classes."
30
+
explanation: "Incorrect. The `sealed` keyword prevents a method from being overridden in derived classes."
31
31
- content: "It allows a class to be used as a base class for other classes."
32
32
isCorrect: false
33
-
explanation: "Incorrect. The 'sealed' keyword prevents a class from being used as a base class for other classes."
33
+
explanation: "Incorrect. The `sealed` keyword prevents a class from being used as a base class for other classes."
34
34
- content: "It prevents a class or class member from being inherited or overridden."
35
35
isCorrect: true
36
-
explanation: "Correct. The 'sealed' keyword in C# is used to prevent a class or class member from being inherited or overridden."
37
-
- content: "What is the purpose of using the 'new' keyword when defining members in a derived class?"
36
+
explanation: "Correct. The `sealed` keyword in C# is used to prevent a class or class member from being inherited or overridden."
37
+
- content: "What is the purpose of using the `new` keyword when defining members in a derived class?"
38
38
choices:
39
39
- content: "To hide base class members intentionally or to avoid accidental overriding of base class members."
40
40
isCorrect: true
41
-
explanation: "Correct. The 'new' keyword allows you to define new members in a derived class that have the same name as members in the base class. The 'new' keyword hides the corresponding base class members."
41
+
explanation: "Correct. The `new` keyword allows you to define new members in a derived class that have the same name as members in the base class. The `new` keyword hides the corresponding base class members."
42
42
- content: "To create a new instance of the derived class."
43
43
isCorrect: false
44
-
explanation: "Incorrect. The 'new' keyword doesn't create a new instance of the derived class."
44
+
explanation: "Incorrect. The `new` keyword doesn't create a new instance of the derived class."
45
45
- content: "To override the base class members with the same name."
46
46
isCorrect: false
47
-
explanation: "Incorrect. The 'new' keyword doesn't override base class members."
48
-
- content: "What is the purpose of the 'override' keyword in C#?"
47
+
explanation: "Incorrect. The `new` keyword doesn't override base class members."
48
+
- content: "What is the purpose of the `override` keyword in C#?"
49
49
choices:
50
50
- content: "It indicates that the member has no implementation and must be overridden in a derived class."
51
51
isCorrect: false
52
-
explanation: "Incorrect. The 'override' keyword doesn't indicate that the member has no implementation and must be overridden in a derived class. This definition matches the `abstract` keyword."
52
+
explanation: "Incorrect. The `override` keyword doesn't indicate that the member has no implementation and must be overridden in a derived class. This definition matches the `abstract` keyword."
53
53
- content: "It indicates that the base class member is extended or modified in the derived class."
54
54
isCorrect: true
55
-
explanation: "Correct. The 'override' keyword in C# is used to extend or modify the behavior of the base class. Overriding provides custom implementations for properties and methods inherited from the base class."
55
+
explanation: "Correct. The `override` keyword in C# is used to extend or modify the behavior of the base class. Overriding provides custom implementations for properties and methods inherited from the base class."
56
56
- content: "It indicates that the derived class hides members of the base class with new implementations."
57
57
isCorrect: false
58
-
explanation: "Incorrect. The 'override' keyword doesn't hide members of the base class with new implementations in the derived class. This definition matches the `new` keyword."
58
+
explanation: "Incorrect. The `override` keyword doesn't hide members of the base class with new implementations in the derived class. This definition matches the `new` keyword."
59
59
- content: "What is the purpose of the `base` keyword in a derived class?"
60
60
choices:
61
61
- content: "To access derived class members from a base class."
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/implement-class-inheritance/includes/1-introduction.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ Imagine you're working at a non-profit company that's in the midst of a software
4
4
5
5
The topics covered in this module include:
6
6
7
-
-Understanding Class Inheritance and Polymorphism in C#
8
-
-Understanding Inheritance, Member Visibility and Keywords in C#
9
-
-Extending Derived Classes with New Members and Resolving Naming Conflicts
10
-
-Overriding and Hiding Properties and Methods in Derived Classes in C#
11
-
-Using the 'base' Keyword to Access Base Class Members from a Derived Class
12
-
-Implementing Base and Derived Classes in C# - Exercise
7
+
-Examine the principals of class inheritance.
8
+
-Configure base and derived classes.
9
+
-Extend a derived class with new members.
10
+
-Override properties and methods in a derived class.
11
+
-Access base class members from a derived class.
12
+
-Implement base and derived classes in a C# app.
13
13
14
14
After completing this module, you're able to:
15
15
@@ -19,6 +19,6 @@ After completing this module, you're able to:
19
19
- Describe the use of `new` and `override` keywords in a derived class.
20
20
- Override properties and methods in a derived class.
21
21
- Access base class members in a derived class.
22
-
- Implement base and derived classes in a C# program.
22
+
- Implement base and derived classes in a C# app.
23
23
24
-
By the end of this module, you have a solid understanding of class inheritance in C# and be able to implement a class hierarchy using base and derived classes.
24
+
By the end of this module, you have a solid understanding of class inheritance in C# and you're able to implement a class hierarchy using base and derived classes.
0 commit comments