Robert

30%
Flag icon
From this declaration, the compiler knows that stamps should contain only Stamp instances and guarantees it to be true, assuming your entire codebase compiles without emitting (or suppressing; see Item 27) any warnings.
Robert
That guarantee can also be violated if you give your instance to library code (might be 'provided' or otherwise opaque) that doesn't respect your type declaration (that the compiler can't see and warn you about)
Effective Java
Rate this book
Clear rating
Open Preview