Bookmark Topic Watch Topic
  • New Topic

Assinging Compile time long constant to byte fails

 
Harish Kommaraju
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I am aware that if you are assigning int to a byte without any implicit cast, then the int should be a compile time constant.
i.e. the below code compile fines.


But if I try the same thing with long, it fails.


Why is that compile time constant of type int can be assigned to byte without any implicit cast, but we cannot assign compile time long to byte?

Thanks,
Harish
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please use one thread per question. Since you've already had one reply here that is where we shall continue.
 
    Bookmark Topic Watch Topic
  • New Topic