This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes confused Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "confused" Watch "confused" New topic
Author

confused

zaghal mohd
Ranch Hand

Joined: Jun 27, 2002
Posts: 43
Could you pleas help me to understand this question?

-11 10
why its not 10 -10
thanks in advs......


SCJP,SCWCD,CCNA,CCAI,MCP,MCSA,MCSE<br />working on CCNP+SCBCD
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Here's a program that I wrote this morning for the next version of my mock exam.

It prints true,true.
If you want to calculate the negative of any number in two's compliment format, then invert the bits and add one. The ~ operator inverts the bits.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
zaghal mohd
Ranch Hand

Joined: Jun 27, 2002
Posts: 43
Thanks you dan you are doing well in your mock exams good luck and thanks again
zaghal
Charu Murali
Ranch Hand

Joined: Jul 12, 2002
Posts: 37
You can easily remember the function of ~ operator as " ~X = (-X)-1 ". So in your question ~10 = (-10)-1 = -11.

HTH.
Charu
 
jQuery in Action, 2nd edition
 
subject: confused