diff --git a/operatoren.md b/operatoren.md index 2bd4213..bd07d3e 100644 --- a/operatoren.md +++ b/operatoren.md @@ -81,17 +81,16 @@ boolean oneLarger = one > two; //oneLarger enthält true boolean result = true && false || !(false || true); //Welchen Wert hat result? ``` 2) ```java - boolean result = true && false || !(false || true); //Welchen Wert hat result? + int two = +3 -6; //Welchen Wert hat two? ``` 3) ```java - boolean result = true && false || !(false || true); //Welchen Wert hat result? + int x = 0; + x += 3; + x =+ 5; //Welchen Wert hat x? + ``` +4) ```java + int a = 3; + int b = ++a - 1; + int c = a++ * 6; //Welchen Wert haben a, b und c? ``` -int two = +3 -6; //Welchen Wert hat two? -int x = 0; -x += 3; -x =+ 5; //Welchen Wert hat x? -ant a = 3; -ant b = ++a - 1; -ant c = a++ * 6; //Welchen Wert haben a, b und c? -``` diff --git a/typumwandlungen.md b/typumwandlungen.md index 716dbb7..4892cbb 100644 --- a/typumwandlungen.md +++ b/typumwandlungen.md @@ -18,7 +18,7 @@ long b = a; Umwandlung in einen kleineren Wertebereich ist nur **explizit** möglich. ```java int d = 3; -byte c = (byte) a; +byte c = (byte) (d); ``` ![bg right 75%](https://miro.medium.com/max/423/1*LQFhTJnVcsXhlQzrgjQIqQ.png)