hi!
i m faheem and preparing java1.4exam
i m very confuse abt this code plz help me how can it complile and what happan behind it;
class A3{
public static void main(String args[]){
int a,b;
a=10;
System.out.println("The value of a is "+a);
char c='32';
System.out.println("The value of character is "+c);
byte tiny=(byte)775; (<------------)
System.out.println("The value of tiny is " +tiny);
}
}
look at this line
byte tiny=(byte)775; (<------------)
System.out.println("The value of tiny is " +tiny);
what happan this
i know abt byte its width is 255;
but we r cast it in "775"
and it is complie and give answer is 7 on this line
and abt one more if we cast it in it 255 it give them a answer 1
and if i put it in 256 it give 0
i m also confuse abt it
is it's width is 256 not 255
and i think it is count 0 also with counting 0 it is not possilbe plz help me
am i right or not