Skip to content

Commit ac465f2

Browse files
Move comment (#45568)
I think it is better to read the output of TestForMammals method right after the method invocation, following the same idea that was implemented for FeedMammals method with output right after the method calls
1 parent b29894b commit ac465f2

File tree

1 file changed

+3
-3
lines changed
  • docs/csharp/fundamentals/tutorials/snippets/safelycast/patternmatching

1 file changed

+3
-3
lines changed

docs/csharp/fundamentals/tutorials/snippets/safelycast/patternmatching/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
SuperNova sn = new SuperNova();
1111
TestForMammals(g);
1212
TestForMammals(sn);
13+
// Output:
14+
// I am an animal.
15+
// SuperNova is not a Mammal
1316

1417
static void FeedMammals(Animal a)
1518
{
@@ -38,9 +41,6 @@ static void TestForMammals(object o)
3841
Console.WriteLine($"{o.GetType().Name} is not a Mammal");
3942
}
4043
}
41-
// Output:
42-
// I am an animal.
43-
// SuperNova is not a Mammal
4444

4545
class Animal
4646
{

0 commit comments

Comments
 (0)