Introduction to OOP: Chapter 10: Subclasses and Subtypes [next] [previous] [audio] [real] [text]

Static and Dynamic classes

We say the class of the declaration is the static class for the variable, while the class of the value is the dynamic class of the variable.

Even statically typed OOP languages permit these two to differ.

var
	pet : Mammal;
	fido : Dog;
	felice : Cat;
begin
	pet := fido;	// legal
end;
Intro OOP, Chapter 10, Slide 6