Add Type Conversion
This commit is contained in:
parent
11948f5dfa
commit
76f23e7af0
|
@ -5,4 +5,21 @@ url: https://git.haw-hamburg.de/pm1-tutorium/slides
|
||||||
---
|
---
|
||||||
|
|
||||||
# Typumwandlungen
|
# Typumwandlungen
|
||||||
|
Eva Meinen und Henri Burau
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Type Conversion
|
||||||
|
widening: **automatisch**
|
||||||
|
|
||||||
|
|
||||||
|
byte → short → int → long → float → double
|
||||||
|
|
||||||
|
char → int
|
||||||
|
|
||||||
|
---
|
||||||
|
narrowing: **explizit**
|
||||||
|
```java
|
||||||
|
int a = 3;
|
||||||
|
byte b = (byte) a;
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue