# shift operators

rajaraman navaneethan

Ranch Hand

Posts: 86

posted 11 years ago

hello friends,

i am preparing for SCJP and i need ur help regarding shift operators.i am not comfortable with shifting negative numbers.can the rule multiplying by 2^number of shifts and divide by 2^number of shifts be applied for negative numbers?

i am also not clear about casting which will be involved in shift operations.will the questions of such type be on the exam?

-192>>2.

can the divide by 2^number of shifts be applied here?

if possible any one of you please send me a list of examples with shift operators that would be sufficient for the exam.

regards

raja

i am preparing for SCJP and i need ur help regarding shift operators.i am not comfortable with shifting negative numbers.can the rule multiplying by 2^number of shifts and divide by 2^number of shifts be applied for negative numbers?

i am also not clear about casting which will be involved in shift operations.will the questions of such type be on the exam?

-192>>2.

can the divide by 2^number of shifts be applied here?

if possible any one of you please send me a list of examples with shift operators that would be sufficient for the exam.

regards

raja

Barry Gaunt

Ranch Hand

Posts: 7729

posted 11 years ago

Have a look at Corey's TipLine Article on shift operations.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch

Getting someone to think and try something out is much more useful than just telling them the answer.

Joe Sondow

Ranch Hand

Posts: 195