Console.WriteLine
method executes.name = 'Gracie'
in the Immediate window and press enter.date = date.AddDays(1)
in the Immediate window and press enter.String.IsNullOrEmpty(name)
method, and it breaks on this line only if the method call returns true
.name
is either null
or String.Empty) has been satisfied, program execution stops when it reaches the breakpoint.Main
is the currently executing method. Observe that the value of the name
variable is '
, that is, String.Empty.name
variable name in the Immediate window and pressing enter.Main
method (press command+).args
array is empty, and name
and date
have default values. In addition, Visual Studio has opened a blank terminal.name
variable assignment. The Locals window shows that name
is null
, and the terminal displays the string 'What is your name?'.date
variable assignment. The Locals window shows the value returned by the call to the Console.ReadLine method. The terminal displays the string you entered at the prompt.date
variable after the assignment from the DateTime.Now property. The terminal is unchanged.