Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic

Downcasting to Byte

 
Sridhar Padala
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Report post to moderator
class Magenta {
static byte a = (byte)127, b = (byte)128, c = (byte)255, d = (byte)256;
public static void main(String args[]) {
System.out.print(a + " " + b + " " + c + " " + d);
}}

How to type cast to byte if the value exceeds byte range? Please explain in detail

Thanks in Advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on books.
 
    Bookmark Topic Watch Topic
  • New Topic