IllegalCastingException CLASS

The casting is illegal. This can happen when the target type is not on the hierarchy of current type's inheritance.

In Julian, object casting is always safe when a type is cast to an super type or the same type. It's not possible to cast to a child type, if the runtime type of variable is indeed that type, or a subtype thereof. If not, or if casting to a side type (the type with which the current type only shares the common ancestor, which in the most common case is Object), will throw this exception.

Casting the primitive type may also cause this exception if the types are not castable (such as from int to bool), or if the target is an Object.

Parent Class

All Members


TypeNameSignature
constructorIllegalCastingExceptionpublic IllegalCastingException(string)

Constructors


public IllegalCastingException(string msg)

Create an instance of IllegalCastingException with specified message. Mainly reserved for system use.

Parameters

  • msg The message for this exception.