DEVFYI - Developer Resource - FYI

What is casting?

Java Interview Questions and Answers (part 2)


(Continued from previous question...)

297. What is casting?

There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.

(Continued on next question...)

Other Interview Questions