How to cast child class instance <p>I don't really know exactly how to word this but basically I need to get the child class instance of an Actor without assigning it (if that makes since?). Is this possible?</p> <pre><code>package org.game.world.entity.actor; import java.util.HashMap; import java.util.Map; import org.game.world.entity.Entity; import org.game.world.entity.actor.npc.NPC; import org.game.world.entity.actor.player.Player; import org.game.world.entity.actor.player.PlayerData; public abstract class Actor extends Entity { /** * The type of Actor this Entity should be * recognized as. */ private final ActorType actorType; /** * A map of ActionStates, not necessarily 'Attributes'. */ private final Map&lt;ActionState, Boolean&gt; actionState = new HashMap&lt;ActionState, Boolean&gt;(); /** * Constructs a new Actor {@Entity}. */ public Actor(ActorType actorType) { this.actorType = actorType; actionState.putAll(ActionState.DEFAULT_ACTION_STATES); } /** * Gets the status of a {@Actor} ActionSate. * @param state The ActionState. * @return The ActionState flag. */ public boolean getActionState(ActionState state) { return actionState.get(state); } /** * Sets a {@Actor} ActionState flag. * @param state The ActionState. * @param flag The flag true:false. */ public void setActionState(ActionState state, boolean flag) { actionState.put(state, flag); } /** * Resets all ActionState's for this Actor. */ public void setDefaultActionStates() { actionState.putAll(ActionState.DEFAULT_ACTION_STATES); } /** * Checks if this Actor is a specific ActorType (i.e NPC) * @param actorType The ActorType * @return */ public boolean isActorType(ActorType actorType) { return this.actorType == actorType; } /** * The type of Actor. */ public static enum ActorType { PLAYER, NPC } } </code></pre> <p>An Actor type.</p> <pre><code>package org.game.world.entity.actor.player; import org.game.world.entity.Location; import org.game.world.entity.actor.Actor; import org.game.world.entity.actor.SkillLink; /** * This class represents a Player {@Actor} in the world. * * @author dillusion * */ public class Player extends Actor { /** * This Player objects unique set of stored * data. */ private final PlayerData playerData; /** * Creates a new Player object in the world. * @param playerData The set of data unique to this Player. */ public Player(PlayerData playerData) { super(ActorType.PLAYER); this.playerData = playerData; } /** * Gets the players name. * @return The name. */ public String getName() { return playerData.name; } /** * Gets the players password. * @return The password. */ public String getPassword() { return playerData.password; } /** * Gets the players permission level. * @return The permission. */ public Permission getPermission() { return playerData.permission; } /** * Gets the players SkillLink instance. * @return The SkillLink. */ public SkillLink getSkillLink() { return playerData.skillLink; } @Override public Location getLocation() { return playerData.location; } @Override public Location setLocation(Location location) { return playerData.location = location; } } </code></pre> <p>But let's say I have multiple 'Actors'. I don't want to have to cast if I don't need to.</p> <p>Sorry if I didn't explain this very well.</p>