## Uses of Class
java.lang.ClassCastException

- Packages that use ClassCastException
  Package | Description
  --- | ---
  javax.rmi | Contains user APIs for RMI-IIOP.
  javax.rmi.CORBA | Contains portability APIs for RMI-IIOP.
  org.w3c.dom.bootstrap |
  org.xml.sax.helpers | This package contains "helper" classes, including support for bootstrapping SAX-based applications.

- - ### Uses of ClassCastException in javax.rmi

    Methods in javax.rmi that throw ClassCastException
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Object` | PortableRemoteObject.`narrow(Object narrowFrom, Class narrowTo)` Checks to ensure that an object of a remote or abstract interface type can be cast to a desired type.

  - ### Uses of ClassCastException in javax.rmi.CORBA

    Methods in javax.rmi.CORBA that throw ClassCastException
    Modifier and Type | Method | Description
    --- | --- | ---
    `Object` | PortableRemoteObjectDelegate.`narrow(Object narrowFrom, Class narrowTo)` Delegation call for `PortableRemoteObject.narrow(java.lang.Object, java.lang.Class)`.

  - ### Uses of ClassCastException in org.w3c.dom.bootstrap

    Methods in org.w3c.dom.bootstrap that throw ClassCastException
    Modifier and Type | Method | Description
    --- | --- | ---
    `static DOMImplementationRegistry` | DOMImplementationRegistry.`newInstance()` Obtain a new instance of a `DOMImplementationRegistry`.

  - ### Uses of ClassCastException in org.xml.sax.helpers

    Methods in org.xml.sax.helpers that throw ClassCastException
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Parser` | ParserFactory.`makeParser()` Deprecated. Create a new SAX parser using the `org.xml.sax.parser' system property.
    `static Parser` | ParserFactory.`makeParser(String className)` Deprecated. Create a new SAX parser object using the class name provided.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.