Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

casting problem

807569Jun 21 2006 — edited Jun 21 2006
Hi,

I have a class called SPlayer which extends Player. Player implements Serializable. I am sending SPlayer objects across a network and want to treat them as Player objects because the client I am sending them to only knows about the Player class and not the SPlayer class.

I have tried casting the SPlayer object to Player but it is still treated as an SPlayer.

Can I get an objects super class or do a 'proper' cast?

Thanks,
Alex
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2006
Added on Jun 21 2006
6 comments
915 views