Question:
Type compatibility & Type conversions (1)
Author: Christian NAnswer:
Operands of an expression must be (data) type compatible to each other – each operation (+, *, ...) ultimately requires operands of the same data type. Two types are compatible if they are • equal, or • one can be converted to the other by implicit type conversion (performed autonomously by the compiler). Implicit (automatic) data type conversion (type promotion) • byte → short → int → long → float → double • char → int • All primitive types → String These conversions never cause data loss!
0 / 5 (0 ratings)
1 answer(s) in total