Forums Register Login

khalid's test que -2

+Pie Number of slices to send: Send
Which statements are true concerning the effect of the >> and >>> operators?
select all valid asn.
one of the corrcect ans given is
(d)The value returned by >>> will never be negative as long as the value of the right operand is equal to or greater than 1.
i think it is not correct ans.
--------
int i=-1;
system.out.println("using >>> and right op is >1 :res : "+i>>>32);
------------
out put: using >>> and right op is >1 :res : -1
+Pie Number of slices to send: Send
Your right, >>> will usually give a positive number but not always as in the case you pointed out. Should say will give you a positive result when the number on the RHS is not the same bit size as the value on the LHS. Well that is probably poor wording, but something like that.
money grubbing section goes here:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 781 times.
Similar Threads
Precedence and associativity of post and pre fix operators
How to configure JBossWorkManager?
Bowled over by a simple code
Please check this qstn from Khalid Mock Exam.
how to accept an instance of a class as a parameter
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:56:25.