I've been writing Java for over 3 years now. Since I'm unemployed I
decided to try to help myself and take the Java Programmers Cert
test. I take the test today at 1pm EST, and I feel confident I'll
pass, but I keep seeing these comparisions come up I've never seen
before. Below are a couple examples and I was just wondering if
someone could email me with a quick explaination on how to read them
properly because I can't find them in any book I have and I've never
seen anyone use them in actual code.
Ex 1:
if (i == 0 ¦ s.length() > 0)
I now know that ¦ == |, but why not use |. More complex
examples are below.
Ex 2:
byte b1 = -12;
byte b2 = -4;
byte b3 = (byte)((b1 + b2) >> c);
//b3 == -2, how??
Why are there two? What does that mean? All I know is that it's
some kind of bit change in this case but I don't understand how. Why
does it differ from the first?