SCJP 5 95% SCJP FAQ | SCJP Mock Tests | SCJP Tipline | Generics
Aakash Goel wrote: int i=1; char c=i;//the copy of i can't be saved in char, short or byte. Too large: 32 bytes char d=2;//works, because an int literal is implicitly cast to char, short or byte if the value fits into the type char c= -2;//fails, because -2 doesn't fit into the unsigned type char !!! char e=(int)3;//works, because (int)3 is still an int literal and value fits into the type char f='f'; int j=f; //works, primitive widening
SCJP 6 - SCJD - SCWCD 5 - SCBCD 5 JavaEnterpriseEditionFaq - TomcatFaq
SCJP 5.0