Posts by Waverunner

    What you're looking to do is to do type-casting: Going from one instance type of the object (SWGObject) to another. You need to be careful though, because you cannot cast an object to an instance if it isn't an instance of that object, which is one of the dangers of an implicit typecast. You won't catch it until you actually test the code, the compiler will still compile the code. This is why the instanceof checks as Ziggy mentioned are useful. When we program we always tend to stick to the lowest possible object for that method, that way type casts are not necessary even when passing them as parameters in a method.

    Basic overview of type casting on simple numeric types:
    More explanation:…l/java-object-typecasting