Originally posted by Raj Kumar:
Hi, in the following code below the maximum value of integer is 2147483647 how when we add 1 to it it's not giving any errors ???
class Q1
{
public static void main(String arg[])
{
byte b=1;
b++;
int i=2147483647+1;
System.out.println(i);
}
}
Originally posted by Raj Kumar:
Thnaks for the reply...
but i don't know how to get that ans. manually
pla. help
Originally posted by Raj Kumar:
yes Keith Lynn ,
when we take this example
byte b = 127 +1;
compile won't say that the size can't fit into byte but it says the outcome of the above is an integer and we are trying to fit that to a byte .
Liar, liar, pants on fire! refreshing plug:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|