This site requires JavaScript, please enable it in your browser!
Greenfoot back
kiarocks
kiarocks wrote ...

2011/7/11

How to change a objects class.

kiarocks kiarocks

2011/7/11

#
Is it possible to change the class of an object? just wondering.
davmac davmac

2011/7/12

#
No, it's not possible. But you can make the behaviour of an object change depending on state (variables in the object), which is usually enough. If that's not enough, a simple solution may be to remove one object and replace it with another (and copy any relevant state to the new object).
kiarocks kiarocks

2011/7/12

#
ok
You need to login to post a reply.