File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Mock Exam Errata and the fly likes khalid's test que -2 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Mock Exam Errata
Reply Bookmark "khalid Watch "khalid New topic
Author

khalid's test que -2

mads pawar
Greenhorn

Joined: Nov 10, 2000
Posts: 4
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
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
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.
 
 
subject: khalid's test que -2
 
Threads others viewed
how to accept an instance of a class as a parameter
How to configure JBossWorkManager?
Please check this qstn from Khalid Mock Exam.
Precedence and associativity of post and pre fix operators
Bowled over by a simple code
IntelliJ Java IDE