File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes casting question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "casting question" Watch "casting question" New topic

casting question

k Oyedeji
Ranch Hand

Joined: Jul 07, 2002
Posts: 96
I have a hopefully easy question. If i have collection which contains objects of specific type and then i iterate through this collection am i right in saying the iterator will return an object of class Object? Can I then cast the objects back to their original datatypes? is that possible without loosing any variable information?
Jon Strayer
Ranch Hand

Joined: Dec 04, 2002
Posts: 133

I agree. Here's the link:
subject: casting question
It's not a secret anymore!