Binding in Java

Java is interesting in that it is syntactically very similar to C++ and semantically very different. In Java all variables are implicitly polymorphic, and all variables and all values know their dynamic type. Reverse polymorphism is performed using a cast, as in C++, but unlike C++ the validity of this transformation is checked at run-time.

There is no virtual keyword, and the binding of message to method is always dynamic, based on the run-time type and not the compile-time declaration of a variable.

An interesting and unique feature in Java is that data fields can also be overritten, but are statically bound. While interesting, I have yet to find any use for this feature.

[audio] [real] Text to accompany slide18, in Chapter 10 of An Introduction to Object-Oriented Programming