Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Java, boolean operators & =, | = ^ = use     - Compare Oracle MySQL (ICP) index condition pushdown is described (Database)

- Improve WordPress performance (Server)

- How to use the DM-Crypt encryption Linux File System (Linux)

- Let Git variety of colors and custom log format output (Linux)

- Elementary OS Freya global menu (Linux)

- Using nmcli commands to manage network in RedHat / CentOS 7.x (Linux)

- Snapshot DataGuard (Database)

- Ubuntu is not in the sudoers file problem solving (Linux)

- Java Prototype Pattern (Programming)

- Detailed PHP code optimization [section] (explain reasons) (Programming)

- SVN hook code set to synchronize Web directory (Server)

- Linux Open coredump (Linux)

- JDK tools jstat (Linux)

- Android Sets the system screen brightness (Programming)

- Incremental garbage collection mechanism for Ruby 2.2 (Programming)

- Ubuntu uses under KVM + Qemu virtual machine build (Linux)

- MySQL Tutorial: Some optimized for I / O memory areas (Database)

- Sublime Text 3 shortcuts summary (Linux)

- Android Studio utility plug organize, create sharp artifact (Programming)

- Adjustment expand VMDK format VirtualBox disk space (Linux)

 
         
  Java, boolean operators & =, | = ^ = use
     
  Add Date : 2018-11-21      
         
         
         
  Today workmates code code review time to see a more fun writing. "Flag & = false;", at first glance, but also I felt he was wrong, but the program works, and quickly go to Baidu, look at the wording in the end is how one thing, it turned out that with the usual common - = + =, and so is the same, but usually use less of it, this really is a tool to enhance the Cock wire feelings, at least not to see this wording does not know what is the meaning of it.

Code is as follows:
 
public class MainMethod {
    public static void main (String [] args) {
        boolean flag = true;
        flag & = true;
        System.out.println ( "true \ t & = \ ttrue \ t ==> \ t" + flag);
        flag = true;
        flag & = false;
        System.out.println ( "true \ t & = \ tfalse \ t ==> \ t" + flag);
        flag = false;
        flag & = true;
        System.out.println ( "false \ t & = \ ttrue \ t ==> \ t" + flag);
        flag = false;
        flag & = false;
        System.out.println ( "false \ t & = \ tfalse \ t ==> \ t" + flag + "\ n");
          
        flag = true;
        flag | = true;
        System.out.println ( "true \ t | = \ ttrue \ t ==> \ t" + flag);
        flag = true;
        flag | = false;
        System.out.println ( "true \ t | = \ tfalse \ t ==> \ t" + flag);
        flag = false;
        flag | = true;
        System.out.println ( "false \ t | = \ ttrue \ t ==> \ t" + flag);
        flag = false;
        flag | = false;
        System.out.println ( "false \ t | = \ tfalse \ t ==> \ t" + flag + "\ n");
          
        System.out.println ( "^ = same is true, except for the false");
        flag = true;
        flag ^ = true;
        System.out.println ( "true \ t ^ = \ ttrue \ t ==> \ t" + flag);
        flag = true;
        flag ^ = false;
        System.out.println ( "true \ t ^ = \ tfalse \ t ==> \ t" + flag);
        flag = false;
        flag ^ = true;
        System.out.println ( "false \ t ^ = \ ttrue \ t ==> \ t" + flag);
        flag = false;
        flag ^ = false;
        System.out.println ( "false \ t ^ = \ tfalse \ t ==> \ t" + flag);
    }
}

Execution results are as follows:

true & = true ==> true

true & = false ==> false

false & = true ==> false

false & = false ==> false

 

true | = true ==> true

true | = false ==> true

false | = true ==> true

false | = false ==> false

 

^ = Same is true, except for the false

true ^ = true ==> false

true ^ = false ==> true

false ^ = true ==> true

false ^ = false ==> false
     
         
         
         
  More:      
 
- Ubuntu study notes and related problem solving (Linux)
- Use SecureCRT to transfer files between Linux and Windows (Linux)
- Convert MySQL date string to a NULL value exception handling (Database)
- Nodejs command-line program development tutorial (Programming)
- CentOS ClamAV antivirus package updates (Linux)
- 20+ Best Practices article MySQL Performance Optimization (Database)
- How to create a someone project on github (Linux)
- BackTrack (BT3, BT4) Linux installation tutorial (Linux)
- Linux System Getting Started Learning: Using the Linux command line detected DVD burner name and write speeds (Linux)
- Oracle TDE transparent data encryption (Database)
- Oracle query start with connect by tree (Database)
- Oracle 11g maintenance partitions - Adding Partitions (Database)
- Oracle can not change the tablespace to backup mode in non-archive mode (Database)
- KVM virtualization of nested virtualization (Linux)
- Getting Started with Linux system to learn: how to use tcpdump to capture TCP SYN, ACK and FIN packets (Linux)
- Docker commonly used commands Description (Linux)
- CentOS7 installation GAMIT and GMT (Linux)
- Timing task Crontab under Linux system (Linux)
- Implement binary search algorithm in C language (Programming)
- Formatted output printf command (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.