java bitwise operators and the equal character; compound operators -


i'm bit confused:

long v = 0; v <<= 8;  v |= 230; 

i know << signed left shift operator , | bitwise inclusive or i'm confused equals does?

so fist v 0. << doesn't have effect? equals 1000 happens then?

edit: i've edited title others might better find question: added "compound operators"

there +=.

for example x+=3 means add 3 x; store x.

v <<= 8; 

left-shifts v 8 bits, , stores v, functionally equivalent v=v << 8.

v |= 230; 

does bitwise or 230 , stores v, equivalent v=v | 230.

now, due performance constraints , optimizations operation may done in place @ low level.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -