Object-Oriented Programming with Java Lecture Notes

25 March 2008 • Generics


Compile-time type checking is available as long as subtype polymorphism isn't in use. Once it is, it's back to casting and run-time type checking:

BlobStack blobStack = new BlobStack()
blobStack.push(new Drip())
Spot spot = (Spot) blobStack.pop()


This page last modified on 24 January 2006.