[ACCEPTED]-Why does Console.Out.WriteLine exist?-reflector
Console.WriteLine is a static method.
Console.Out is a static object 8 that can get passed as a parameter to any 7 method that takes a
TextWriter, and that method could 6 call the non-static member method
An example 5 where this would be useful is some sort 4 of customizable logging routines, where 3 you might want to send the output to
Console.Error) or 2 nowhere (
System.IO.TextWriter.Null), or anything else based on some 1 runtime condition.
Brad Abrams (The founding member of both CLR and .NET 2 framework at Microsoft) says the following.
Console.WriteLine() is simply a shortcut for Console.Out.WriteLine. Console was overloaded by WriteLine propery to make that much easier to write.
Source: Book 1 "The C# Programming Language by Anders Hejlsberg".
More Related questions