Comment on Tutorial - How to use Iterator in Java By Fazal
Comment Added by : Steve
Comment Added at : 2012-01-18 15:58:31
Comment on Tutorial : How to use Iterator in Java By Fazal
I would like to know how to obtain the object that the Iterator is actually referencing. Not all ArrayLists will be storing Strings, and no matter what I do I cannot obtain the object being referenced by that iterator.
For example, if my ArrayList is storing MyClass objects I want to do something like this:
Iterator iter = theArrayList.iterator();
MyClass current = (MyClass)iter; // <--- What do I do here?
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
2. I'm coding a webservice and this is exactly what I
View Tutorial By: Cristian at 2014-11-14 12:52:34
3. Hi for Java beginners this is the right place to s
View Tutorial By: Anon at 2009-02-01 21:14:28
5. that's what I've been looking for!!!!!!!!!!!!!!!!!
View Tutorial By: bibi at 2014-12-28 20:43:56
7. we can write an abstract class without any abstrac
View Tutorial By: keerthi at 2013-08-20 16:31:38