The moose likes Beginning Java and the fly likes casting question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "casting question" Watch "casting question" New topic
Author

casting question

k Oyedeji
Ranch Hand

Joined: Jul 07, 2002
Posts: 96
Hi
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?
Thanks
Jon Strayer
Ranch Hand

Joined: Dec 04, 2002
Posts: 133
Yes.


Jon
 
IntelliJ Java IDE
 
subject: casting question
 
Threads others viewed
Passed 151/155
References to an object in multiple collections.
Difference between Java 5 adn Java 1.4
GC
HashMap and HashSet
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture