Ole Sandum wrote:Hi, orry.
Primitives cannot be cast the same way reference variables can. Maybe you are talking about primitive type conversion? Or maybe you are trying to cast between the wrapper types Float and Long?
If you are trying to do the latter, that is impossible because none of those two classes inherits from the other.
Maybe it would help if you showed us some code showcasing the problem?
Well im working on some past papers and this question came up:
Long v1 = 10L;
Float v2 = 10.3F;
Observe what happens when you remove the L and F. Rewrite these lines using casting.
so so far i put this but no luck due to it saying they cannot be casted: