File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
src/BehavioralPatterns/TemplateMethod/TemplateMethodLibrary/BreadExample Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ public void Make()
14
14
Slice ( ) ;
15
15
}
16
16
17
- public abstract void MixIngredients ( ) ;
17
+ protected abstract void MixIngredients ( ) ;
18
18
19
- public abstract void Bake ( ) ;
19
+ protected abstract void Bake ( ) ;
20
20
21
- public virtual void Slice ( )
21
+ protected virtual void Slice ( )
22
22
{
23
23
Console . WriteLine ( $ "Slicing the { GetType ( ) . Name } !") ;
24
24
}
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ namespace TemplateMethodLibrary.BreadExample
4
4
{
5
5
public class WhiteBread : Bread
6
6
{
7
- public override void MixIngredients ( )
7
+ protected override void MixIngredients ( )
8
8
{
9
9
Console . WriteLine ( "Gathering ingredients for white bread." ) ;
10
10
}
11
11
12
- public override void Bake ( )
12
+ protected override void Bake ( )
13
13
{
14
14
Console . WriteLine ( "Baking the white bread for 15 minutes." ) ;
15
15
}
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ namespace TemplateMethodLibrary.BreadExample
4
4
{
5
5
public class WholeWheatBread : Bread
6
6
{
7
- public override void MixIngredients ( )
7
+ protected override void MixIngredients ( )
8
8
{
9
9
Console . WriteLine ( "Gathering ingredients for whole wheat bread." ) ;
10
10
}
11
11
12
- public override void Bake ( )
12
+ protected override void Bake ( )
13
13
{
14
14
Console . WriteLine ( "Baking the whole wheat bread for 20 minutes." ) ;
15
15
}
You can’t perform that action at this time.
0 commit comments