aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes | operator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "| operator" Watch "| operator" New topic
Author

| operator

Andrey Opanasets
Greenhorn

Joined: Aug 14, 2001
Posts: 17
Which of the following are true. Select all correct answers.

1. && operator is used for short-circuited logical AND.

2. ~ operator is the bit-wise XOR operator.

3. | operator is used to perform bitwise OR and also short-circuited logical OR.

4. The unsigned right shift operator in Java is >>.

My answer is 1 and 3. But tests answer is 1. Can anybody explain why 3 is not correct?
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Test says true.....
| operator is used to perform bitwise OR and also short-circuited logical OR.
The first part of statement is true but second part is not.For short-circuited | | is used.
Bye.
Viki.
------------------
Count the flowers of ur garden,NOT the leafs which falls away!i
[This message has been edited by Vikrama Sanjeeva (edited November 07, 2001).]


Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
fengqiao cao
Ranch Hand

Joined: Oct 26, 2001
Posts: 71
hi,
because | is not short-circuit operator. in jave only && and | | are short circuit operator.
hopes help
Andrey Opanasets
Greenhorn

Joined: Aug 14, 2001
Posts: 17
| we may used as a logical operator. It confused me.
thanx to all.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: | operator
 
Similar Threads
operators
Caught in Fundas
Jxam
another Mock Exam Question
Short-Circuit Logical Operator!!!