Exclusive or operation

Source: Internet
Author: User

Public void setopen (Boolean open, Boolean animate) {<br/> If (isopen () ^ open) {// The same is false, true </P> <p >}< br/> Public Boolean isopen () {<br/> return mcontent. getvisibility () = visible; <br/>}< br/> 

 

As shown in the code above. You need to implement setopen () // to enable and disable a panle. Benefits of using exclusive or operations

A ^ B. When A and B are the same --> false, A, and B are true.

 

1. when panle is invisible, if it is open = true, panle visible should be executed in the IF statement block. If it is open = false, it is invisible, all if statement blocks are not executed.

2. when panle is visible, if it is open = true, panle visible should be implemented. If it is open = false, the IF statement block will not be executed. If it is open = false, it will be visible, and all the if statement blocks will be executed.

 

When using an exclusive or statement, consider not all the above situations !!!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.