Assuming it compiles…
The first one invokes the WriteLine
method of the System.Console
class. This is the normal mechanism for writing text output to the console.
The second one is using a class called WriteLine
and assigning a value to its Text
property. The question is – what is this WriteLine
class?
Assuming it’s not your own invention, or part of some library you are using, perhaps it is the System.Activities.Statements.WriteLine
class. You can check if you have a using
statement at the top of your file that imports the System.Activities.Statements
namespace. (You would also have had to reference the System.Activities.dll
assembly.)
By itself, this will not actually do anything. The resulting class would have to be used in some other way to have any effect.
The System.Activities.Statements.WriteLine
class and the assembly it belongs to are part of Windows Workflow Foundation.
See also, the answer to this StackOverflow question, which shows an example usage of the WriteLine
class.
solved What is the difference between console.writeline(“hello world”) and new WriteLine(){Text=”Hello World”} [closed]