Logical Operators (Not Short-Circuit) : boolean Operators « Operators « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Operators » boolean Operators 
2.8.4.Logical Operators (Not Short-Circuit)
& non-short-circuit AND
| non-short-circuit OR

public class MainClass{
    public static void main(String[] argv){
        int z = 5;
        if(++z > || ++z > 6z++;   // z = 7 after this code
        System.out.println(z);
        //versus:
        
         z = 5;
        if(++z > | ++z > 6z++;   // z = 8 after this code

        System.out.println(z);
    }
}
7
8
2.8.boolean Operators
2.8.1.Java Boolean operators
2.8.2.Short-Circuit Logical Operators
2.8.3.Using the Boolean and Logical Short-Circuit Operators
2.8.4.Logical Operators (Not Short-Circuit)
2.8.5.Java does not permit you to cast any type to boolean
2.8.6.Involve calculation in the short-circuit logical operators
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.