java.lang.ClassCastException [英] java.lang.ClassCastException

查看:136
本文介绍了java.lang.ClassCastException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常是什么原因得到java.lang.ClassCastException ..?我的应用程序中出现以下错误

Normally whats the reason to get java.lang.ClassCastException ..? I get the following error in my application

java.lang.ClassCastException: [Lcom.rsa.authagent.authapi.realmstat.AUTHw


推荐答案

根据文档

抛出以指示代码已尝试将 Object 强制转换为子类
,而该子类不是实例。例如,以下代码生成 ClassCastException

Thrown to indicate that the code has attempted to cast an Object to a subclass of which it is not an instance. For example, the following code generates a ClassCastException:

Object x = new Integer(0);
System.out.println((String)x); 

这篇关于java.lang.ClassCastException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆