Java View all facts Glossary Help |
mechanism > casting > casting an object |
casting an object comparison table |
Subject | use | have syntax | done | has definition | is a kind of | perform |
---|---|---|---|---|---|---|
casting | The process of producing a new value that has a different type than its source | mechanism | ||||
casting an object | to convert an object to a primitive type - use a wrapper class instead | (classname)object | explicitly if the destination type is a superclass of the source type | casting | if the source and destination types of the object are related by inheritance - one class must be a subclass of the other |
Next casting: casting a primitive type Up: casting