Objektorientierte Programmierung in JavaopenHPI-Java-Team

This video belongs to the openHPI course Objektorientierte Programmierung in Java. Do you want to see more?

4.2 Type Casting

Time effort: approx. 10 minutes

An error occurred while loading the video player, or it takes a long time to initialize. You can try clearing your browser cache. Please try again later and contact the helpdesk if the problem persists.

About this video


Folie 8 (Parsing):
Typo: Interger -> Integer

Folie 5:
Bei der Rechnung mit Fließkomma- und Gleitkommazahlen wird genau dann automatisch ein Type Casting ausgeführt, wenn in die Rechnung eine Fließkommazahl einfließt. Das Casting findet nicht von Anfang an statt, sondern erst sobald es benötigt wird. So ist (6/7)*8.0 immer noch 0.0, weil zuerst die Klammer ausgeweret wird (also eine Integerdivision mit dem Ergebnis 0 stattfindet, dieses dann zu 0.0 gecastet wird und anschließend mit 8.0 mulitpliziert wird (was immer noch 0.0 ergibt).