Re: Why is Java lying?



java does not know that that "Object" is a "String".
it does know that "String"s are "Object"s.

I know this doesn't answer the basic question, but if it is just the string
you want,

String attr = e.nextElement().toString();

should work without casting.


.