type-slicing

Design problem regarding type slicing with many different subclasses.

A basic problem I run into quite often, but ever found a clean solution to, is one where you want to code behaviour for interaction between different objects of a common base class or interface. To make it a bit concrete, I'll throw in an example; Bob has been coding on a strategy game which supports "cool geographical effects". These r...

Object slicing in Java.

Can you take a subclass object and somehow convert it to an object of the same type as the parent class and at the same time slicing all the fields that are not part of the parent class? I know you can do this in C++, but I have no idea how to do it in Java. ...