Saturday, September 3, 2011

Difference between && and & operator in c#

In c# I always prefer to use && operator than & operator, reason behind can be described efficiency in code execution.

If we use && operator, the second conditional statement (the statement on the right of the &&) will not be executed if the first conditional statement is false. But this is not case when we use & operator

Same is the case while using || and | operator

No comments:

Post a Comment

Open default email app in .NET MAUI

Sample Code:  if (Email.Default.IsComposeSupported) {     string subject = "Hello!";     string body = "Excellent!";    ...