Code example detailing variable shadowing doesn't have expected output listed, may cause more confusion than clarification.
public class HelloWorld
{
public string message = "Hello World";
public void SayHello()
{
string message = "Goodbye World";
// The line below prints "Goodbye World"
Console.WriteLine(message);
// The line below prints "Hello World"
Console.WriteLine(this.message);
}
}
Suggested change would be to add expected output after code block:
using Greetings;
HelloWorld hello = new HelloWorld();
hello.SayHello();
//expected output:
//Goodbye World
//Hello World
Relevant Link
Code example detailing variable shadowing doesn't have expected output listed, may cause more confusion than clarification.
Suggested change would be to add expected output after code block: