Adrian, In the example g doesn't require a cast because what is assigned to it is 1. compile time constant integer (value 13)..(no variables involved), and 2. the constant fits in the type byte. So the compiler is happy...
whereas variable h is assigned values of another variable(s), which is not considered compile time constant (unless the variable is a final constant)..to the compiler it means that the value of the variable may change while the program is running, so it flags an error.
thank U Mr. roopesh The Information given by U was Basi information. But Worth forgetting
######33 Agrah upadhyay 3rd Year Bioinformatics
<i>--Agrah Upadhyay--</i><br />Final Year B.Tech SCJP,SCWCD,SCBCD <br /> <br /><b>Now since the real test for any choice is having to make the same choice again,knowing full well what it might cost.</b>-Oracle
Joined: Nov 19, 2004
Thanks a lot, that makes sense it being a compile time constant within the range of the variable. The code proves it as well.
Joined: Sep 10, 2005
I Dont Think We Should Comment on any post,what i know that mr Roopesh provided us with a very simple and good and informative logic,and for every posting one should be appreciated,so Thanks mr Roopesh