Results 1 to 2 of 2
  1. #1
    jagdish_ is offline Member
    Join Date
    Jun 2010
    Posts
    1
    Rep Power
    0

    Default 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

  2. #2
    HerrK. is offline Member
    Join Date
    Jun 2010
    Location
    Berlin
    Posts
    22
    Rep Power
    0

    Default

    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

  1. Java Collection class & methods
    By box2box in forum New To Java
    Replies: 2
    Last Post: 05-26-2010, 02:51 AM
  2. Collection - java
    By Moonlightkid in forum Advanced Java
    Replies: 3
    Last Post: 09-02-2008, 06:04 AM
  3. Java Collection Framework (Lists)
    By Java Tutorial in forum Java Tutorial
    Replies: 1
    Last Post: 05-16-2008, 02:44 PM
  4. Replies: 2
    Last Post: 04-21-2008, 12:43 PM
  5. Java Collection Framework (Sets)
    By Java Tutorial in forum Java Tutorial
    Replies: 0
    Last Post: 12-07-2007, 08:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •