Hi,
wieso klappt hier eine automatische Typumwandlung:
Aber hier nicht????
Danke.
p-flash
wieso klappt hier eine automatische Typumwandlung:
Code:
public class Calculation
{
public static void main(String[] arguments)
{
byte a = 127;
byte b = 127;
int result;
result = a + b;
System.out.println("Ergebnis = " + result);
}
}
Code:
public class Calculation
{
public static void main(String[] arguments)
{
int a = 2147483647;
int b = 2147483647;
long result;
result = a + b;
System.out.println("Ergebnis = " + result);
}
}
Danke.
p-flash