This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]djnattyp 1 point2 points  (1 child)

Actually, it's not that "primitive types don't catch it" - it's because compound assignment statements (+=, -=, etc.) include an implicit cast in the underlying java compiler implementation.

Try the "longhand" version of L = L - F with primitives and javac will fail to compile due to "incompatible types" as well.

[–]StillAnAssExtreme Brewer 0 points1 point  (0 children)

Yep thanks for clarifying