Object slicing in Java.

Posted by ferrari fan on Stack Overflow See other posts from Stack Overflow or by ferrari fan
Published on 2010-03-25T18:22:01Z Indexed on 2010/03/25 18:23 UTC
Read the original article Hit count: 293

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about type-slicing