Results 1 to 2 of 2
- 06-12-2010, 02:04 PM #1
Member
- Join Date
- Jun 2010
- Posts
- 1
- Rep Power
- 0
java collection arraylist in jdk 1.4
i have an arraylist which stores both String & Integer objects. I want to remove
String objects from this array list. It is in JDK 1.4 so I can't use generics.
Is there a way without using iterator to remove objects of specific type from collection.
Thanks In advance
- 06-12-2010, 02:19 PM #2
Member
- Join Date
- Jun 2010
- Location
- Berlin
- Posts
- 22
- Rep Power
- 0
Well, it is not important to mention, that you don't have any generics (while Integer and String is not of the same type).
The question is, why to store different types inside some ArrayList? And why the restriction of not using the iterator? If you have a solution for the iterator, just have a look at the corresponding API entry of the List Interface or ArrayList class ArrayList (Java 2 Platform SE v1.4.2). You will find more than one way to iterate over the elements
Similar Threads
-
Java Collection class & methods
By box2box in forum New To JavaReplies: 2Last Post: 05-26-2010, 01:51 AM -
Collection - java
By Moonlightkid in forum Advanced JavaReplies: 3Last Post: 09-02-2008, 05:04 AM -
Java Collection Framework (Lists)
By Java Tutorial in forum Java TutorialReplies: 1Last Post: 05-16-2008, 01:44 PM -
Java Project Trouble: Searching one ArrayList with another ArrayList
By BC2210 in forum New To JavaReplies: 2Last Post: 04-21-2008, 11:43 AM -
Java Collection Framework (Sets)
By Java Tutorial in forum Java TutorialReplies: 0Last Post: 12-07-2007, 07:50 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks