title: Convert an int to byte in java
body: <pre><code>String boxVal = "FB";
  Integer val = Integer.parseInt(boxVal, 16);
  System.out.println(val); //prints out 251
  byte sboxValue = (byte) val;
  System.out.println("sboxValue = " + Integer.toHexString(sboxValue)); //fffffffb
  </code></pre>
  
  <p>The last line should print out "fb". I am not sure why it prints out "fffffffb."
  What am I doing wrong? How should I fix my code to print "fb"?</p>