SEARCH
You are in browse mode. You must login to use MEMORY

   Log in to start


From course:

Introduction to Java

» Start this Course
(Practice similar questions for free)
Question:

Type compatibility & Type conversions (1)

Author: Christian N



Answer:

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