Top.Mail.Ru
April 19th, 2003 - Java developers — LiveJournal
? ?

Java developers

April 19th, 2003
Image

08:54 am - Imagegrrlpower - bits and bytes and shifting, oh my!

I am studying to take the Sun Certification exam on Tuesday, but I'm having trouble wrapping my head around the shift and bitwise operators, primarily because my college dropped the 'discrete math' pre-req to java before I took the course. I'm a bit (no pun intended) nervous because as I'm working through my study guide, I'm seeing a fair number of questions dealing with these operators and I have no idea how to calculate the new values - I've read about which are signed and which are not, but I have no idea how to calculate the value itself. Can anyone point me to an online reference so I can try to figure some of this out to salvage a few percentage points?

 -31 >>> 5 >> 5 >>> 5 >> 5 >>> 5 >> 5

HUH????
Image

11:57 pm - Imageomegatetris

I'm in an intro programming class that uses Java to teach. I've created a class (paper.class) that takes two variables, sets the longer as the length and the shorter as the width, and then returns them in other methods. They also want me to make a test harness which will test these for every combination of dimensions from .5 to 20 (increments of .25). I can do it for one combination and while one changes and the other remains constant, but I can't figure out how to put in another loop properly to go through the full range of combinations. The problem seems to be in resetting the length when the width advances. I've been trying to do this for six hours.

Here is what I have so far:Collapse )

The "lt" things are less-than signs, I don't know why they didn't show up properly within the xmp tags. I'm sure the problem with my code is trivial... I'm not very good at making loops anyway.
Powered by LiveJournal.com
Image