Name: yyT116575 Date: 08/06/2001
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
When executing
> Object obj = new Integer(0);
> String s = (String) obj;
the current error message is as follows:
> Exception in thread "main" java.lang.ClassCastException: java.lang.Integer
> at T.main(T.java:13)
It would be better to have a more explicit error message like:
> Exception in thread "main" java.lang.ClassCastException: cannot cast from
java.lang.Integer to java.lang.String
> at T.main(T.java:13)
This is especially true in a distributed environment where some classes
(stubs/skeletons) are generated and not all source code is available.
(Review ID: 129472)
======================================================================