Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Is this sentence right? 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 "Is this sentence right?" Watch "Is this sentence right?" New topic
Author

Is this sentence right?

theMatrix
Greenhorn

Joined: Jun 15, 2001
Posts: 4
In java,the value returned by >>> will never be negative as long as the value of the right operand is equal to or greater than 1.
Jyotsna Umesh
Ranch Hand

Joined: May 09, 2001
Posts: 94
I think if you don't put any condition even then >>> would never return negative value, what do others have to say about this.
Jyotsna
Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
Very true !
>>> always results in a positive no.


[SCJP2, SCWCD1.3, SCBCD]
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Actually, not true try this:
System.out.println(-20>>>32);
don't forget that for ints the shift is actually %32 and for longs it is %64.
Dave
by the way 'theMatrix' you might want to change your name before one of the bartenders says something about it.
[This message has been edited by Dave Vick (edited June 20, 2001).]
[This message has been edited by Dave Vick (edited June 20, 2001).]


Dave
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
I think that I have ALREADY asked him to re-register. The clock is ticking. Soon someone will just kill the ID.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Jyotsna Umesh
Ranch Hand

Joined: May 09, 2001
Posts: 94
oh yes, I was wrong, it was a silly mistake.
Jyotsna
Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
That was something !
Thanks Dave !!
 
GeeCON Prague 2014
 
subject: Is this sentence right?