Why does this line compile without error?

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

Note the space just in front of ".Add"



HttpContext.Current.Session .Add("PeriodSelectedOnTripSummary",value);
 
Since this is C#, it is much more forgiving about syntax. White spaces are
typically ignored by the compiler. The only "rule" is you must have a ';'
at the end of every command.

if(true){Console.Write("hello");Console.WriteLine("world.");}

I would never recommend the above code, but spaces are merely used to
separate tokens, such as variables names, types, etc.

bill
 
Back
Top