Home > DeveloperSection > Forums > Multiple Conditions in If Statement or Splitting using C#
F Scott Fitzgerald
F Scott Fitzgerald

Total Post:29

Posted on    October-14-2013 7:25 AM

 C# C# 

 1 Reply(s)
 932  View(s)
Rate this:

when i am using if statements with multiple conditions, how are they managed in the compiler?

A) Will it ignore the second Statement, if the first statement is not fulfilled or vice versa?

If(time > 3.0 && hitEnabled)

B) Late Defintions are often recommended, so should i prefere to use one condition in if statements?

if(time > 3.0)


Babe Zaharias
Babe Zaharias

Total Post:19

Posted on    October-14-2013 7:49 AM

String someString = null;
        if (someString != null && someString[4].Equals('a'))
            //// not called
        if (someString != null || someString[4].Equals('a'))
            //// exception

Don't want to miss updates? Please click the below button!

Follow MindStick