First page Back Continue Last page Overview Text


Well, how about changing the class of an object?

In this fairly simple example, we are creating two classes, Foo and Bar. We create an instance of Foo, then set the class of the instance to Bar. When we ask the instance for it's class, it tells us the class is now Bar.