O'Reilly logo

A Programmer’s Guide to Java® SE 8 Oracle Certified Associate (OCA) by Rolf W Rasmussen, Khalid A Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5. Operators and Expressions

Image

5.1 Conversions

In this section we first discuss the different kinds of type conversions that can be applied to values; in the next section we discuss the contexts in which these conversions are permitted. Some type conversions must be explicitly stated in the program, while others are performed implicitly. Some type conversions can be checked at compile time to guarantee their validity at runtime, while others will require an extra check at runtime.

Widening and Narrowing Primitive Conversions

For the primitive data types, the value of a narrower data type can be converted to a value of a wider data type. This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required