Posted By

Tonguc on 01/19/14


Tagged


Versions (?)

Crazy assignment issues with byte, short and char


 / Published in: Java
 

This will give compile error

  1. byte a = 3; // No problem, 3 fits in a byte
  2. byte b = 8; // No problem, 8 fits in a byte
  3. byte c = b + c; // Should be no problem, sum of the two bytes
  4. // fits in a byte

Report this snippet  

You need to login to post a comment.