-8

Possible Duplicate:
Java Operators : |= bitwise OR and assign example

boolean bAlive;

bAlive |= this.properties.containsKey(name);

In the above , the code uses '|'. Why using '|' ?

Thanks in advance.

1
  • 2
    try accepting the answers if u find yourself satisfied according to your question... Commented May 23, 2012 at 4:58

1 Answer 1

5

The boolean is being OR'ed with the value on the right.

If this.properties.containsKey(name) is TRUE, then bAlive is set to TRUE.

Otherwise, bAlive remains the same.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.