Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What is the difference between '|' and '||' operators

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 140
    Comment on it

    Hello Reader's you might have seen the coding standard with the common syntax | and || is used. These are the syntax used for checking the conditions and sub conditions. The first | is called as bit wise Operator. It is used to make the condition between two numbers. But the working difference is if the condition is true/false it will again check for another condition if applied where in case of '||' operator the if the condition is found true then it will not compare another conditions

    For example:

    if(condition1 || condition2 || condition3)
    

    If condition1 is true, condition 2 and 3 will NOT be checked.

    if(condition1 | condition2 | condition3)
    

    Now in this condition all the conditions will be checked.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: