The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 (Not So) Stupid Questions 7: >>, >>>, <<, and ?: operators
Subject:  Operators
Date:  2006-01-17 06:31:49
From:  heaththegreat


From:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/bitwise.html

op1 << op2
Shifts bits of op1 left by distance op2; fills with 0 bits on the right side

op1 >> op2

Shifts bits of op1 right by distance op2; fills with highest (sign) bit on the left side

op1 >>> op2 Shifts bits of op1 right by distance op2; fills with 0 bits on the left side


From:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/other.html

op1 ? op2 : op3

If op1 is true, returns op2; otherwise, returns op3

 Feed java.net RSS Feeds