Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

i beg your correct answers

  Asked By: Bibhuti    Date: Aug 03    Category: Java    Views: 1455

1.we know both float and int have same size in java but how can float can represent large number of values (high range)than int variable?

2.i went through the kathy seirra book and found a doubt like......

the book says
byte b=120;
is saying exactly as
byte b=(byte)120;
bcoz compiler does the casting by adding casting instruction (byte) at the time of compilation.

why compilet does not add any casting instruction in the following case

byte b=130; //leads to CE:passible loss of precession.

so when does compiler add this casting instruction and when it ignores..???