Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.19 seconds.

  1. Replies
    8
    Views
    2,412

    Re: ArrayList implementation

    Why don't you just use a Set?
  2. Replies
    8
    Views
    2,412

    Re: ArrayList implementation

    Why do you need to extend ArrayList in the first place?

    If you need to keep track of two separate types (as opposed to simply keeping track of a single parent type), then you either need two...
  3. Replies
    8
    Views
    2,412

    Re: ArrayList implementation

    It won't. It'll return an A reference, which you can cast to the appropriate type. If you really need to be able to return a B or C from an ArrayList, you're going to have to keep track of two...
  4. Replies
    8
    Views
    2,412

    Re: ArrayList implementation

    Can't you just use an ArrayList of A?

    ArrayList<A> list = new ArrayList<A>();
Results 1 to 4 of 4