Skip to content

Commit baec64a

Browse files
authored
changed files by pdets auto publish service, publishid[00539da6-8d71-400a-b69a-258e1cd0fff5] and do [publish].
1 parent 3acda26 commit baec64a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

learn-pr/wwl-azure/discover-interfaces/7-knowledge-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ quiz:
2525
explanation: "Incorrect. Interface properties aren't required to be static."
2626
- content: "You're implementing an interface in a class. What must you ensure?"
2727
choices:
28-
- content: "Provide public, non-static implementations for all interface members."
28+
- content: "Provide public, nonstatic implementations for all interface members."
2929
isCorrect: true
30-
explanation: "Correct. When a class implements an interface, it must provide public, non-static implementations for all interface members."
30+
explanation: "Correct. When a class implements an interface, it must provide public, nonstatic implementations for all interface members."
3131
- content: "Provide private implementations for all interface members."
3232
isCorrect: false
3333
explanation: "Incorrect. Interface members must be implemented as public, not private."
3434
- content: "Provide static implementations for all interface members."
3535
isCorrect: false
36-
explanation: "Incorrect. Interface members should be implemented as non-static."
36+
explanation: "Incorrect. Interface members should be implemented as nonstatic."
3737
- content: "In a scenario where you need to implement an interface in a class, what syntax is used?"
3838
choices:
3939
- content: "class ClassName : InterfaceName"

learn-pr/wwl-azure/discover-interfaces/includes/3-create-interface-properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Interface properties typically don't have any code inside them, they just specif
2323
When a class, like `Car`, decides to implement an interface, such as `IVehicle`, it's like saying "I'm going to build a vehicle." The `Car` must include all the features (properties or methods) outlined in the `IVehicle` blueprint.
2424

2525
- The `Car : IVehicle` syntax is used to indicate that `Car` is implementing the `IVehicle` interface. You use the familiar syntax, the same as used for inheritance.
26-
- The `Car` must provide public, non-static implementations for all the features listed in the `IVehicle` blueprint.
26+
- The `Car` must provide public, nonstatic implementations for all the features listed in the `IVehicle` blueprint.
2727
- If `Car` decides to implement multiple blueprints (interfaces) that have similar features, it needs to be clear about which feature comes from which blueprint.
2828

2929
Here's how `Car` implements the `IVehicle` interface in code:

learn-pr/wwl-azure/discover-interfaces/includes/5-understand-value-interfaces.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Interfaces in C# are structural contracts that define a set of related functions
66
- **Code Quality**
77
- **Polymorphism**
88

9-
## Code Reusability
9+
## Code reusability
1010

1111
By defining a common set of methods in an interface, multiple classes can implement those methods, creating interchangeable objects. This is one of the main advantages of using interfaces in C#.
1212

@@ -41,17 +41,17 @@ public class Bike : IVehicle
4141

4242
In this example, both the `Car` and `Bike` classes implement the `IVehicle` interface. The `Drive()` method is reused in both classes, demonstrating code reusability.
4343

44-
## Enhanced Maintainability
44+
## Enhanced maintainability
4545

4646
Interfaces contribute to the maintainability of your code by promoting modularity. If you need to add a new type of vehicle to your system, you can simply create a new class that implements the `IVehicle` interface.
4747

4848
For example, if you want to add a `Truck` class, you can do so without affecting the existing `Car` and `Bike` classes. This separation of concerns makes your code easier to manage, update, and debug, enhancing its overall maintainability.
4949

50-
## Error Prevention
50+
## Error prevention
5151

5252
If a class declares it implements an interface but doesn't provide all necessary methods, the C# compiler will generate an error. This ensures adherence to the defined contract and helps prevent potential errors in your code.
5353

54-
## Code Quality
54+
## Code quality
5555

5656
Interfaces in C# help to structure your code and make it adaptable. They allow classes to indicate they can perform certain actions or behaviors. This is particularly beneficial in a team setting where different developers are working on different parts of a system. By using interfaces, each developer has a clear contract of what a class should do, allowing them to work independently on their respective classes without needing to know the internal workings of each other's classes. This leads to cleaner, more organized code, enhancing overall code quality.
5757

0 commit comments

Comments
 (0)