This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

| operator

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
because | is not short-circuit operator. in jave only && and | | are short circuit operator.
hopes help
 
Andrey Opanasets
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
| we may used as a logical operator. It confused me.
thanx to all.
 
reply
    Bookmark Topic Watch Topic
  • New Topic