hi,
have a look at the below code......
class A{
Static void main(
String args[]){
byte b1 = 33;
b1++;
byte b2 = 55;
b2 = b1 + 1;// 1
System.out.println(b1 + " " +b2);
}
}
In the above code compilation error is occuring at line 1. Says cant cast from int to byte. I know that byte values range from -128 to 127. Then why b1 value is not accepted as byte.what is the error? am i missing any point in casting.please explain.
Thankz