本文介绍了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
发布评论