posted 21 years ago
Pl. suggest,
int I=90;
char c=I; //cating required, agreed . . .
final int ii =90;
char c=ii; // casting not req. , agreed ,will
// compile . . .
char f=65;
char x=f ; // compiles, agreed . . .
// char x=f >> 1; // not compiling . . . WHY?
Problem :
Why this is not compiling -
char x =f >> 1;
What I am assuming is that var. f will hold any value within the range Of character , therefore when we say - char x=f, codes get
Compiled.But why - char x=f >> 1; will not compile where
Signed right shift ( >> ) will always reduce the value of
Var. f & it will always remain within the range of characters.
Thanks,
Vikas