title: Object slicing in Java
body: <p>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?</p>
  
  <p>I know you can do this in C++, but I have no idea how to do it in Java.</p>