Add Type Conversion
This commit is contained in:
@ -5,4 +5,21 @@ url: https://git.haw-hamburg.de/pm1-tutorium/slides
|
||||
---
|
||||
|
||||
# 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;
|
||||
```
|
||||
|
Reference in New Issue
Block a user