Results 1 to 2 of 2
  1. #1
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default addAll method in List

    1 what does ? in addAll(Collection<? extends E> c) mean?
    2 what does extends in addAll(Collection<? extends E> c) mean?
    (extends seems to mean any data type that is subclass of E)

    Thanks a lot

  2. #2
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    4

    Default

    Have you learned about Generics? I suggest you read about them here:
    Lesson: Generics (The Java™ Tutorials > Bonus)

    But to answer your questions:
    1. ? means any and all classes are acceptable.
    2. extends means any and all classes that extend E are acceptable.

Similar Threads

  1. Recursive Linked List method: RemoveAll
    By cjw92 in forum New To Java
    Replies: 5
    Last Post: 03-11-2011, 03:51 AM
  2. List Sorting method.
    By bit_bit in forum New To Java
    Replies: 1
    Last Post: 02-24-2010, 12:44 PM
  3. Filter in Fileconnector's list() method
    By arnab321 in forum CLDC and MIDP
    Replies: 0
    Last Post: 03-12-2009, 05:53 PM
  4. [SOLVED] Writing an Iterator method in a custom list
    By xcallmejudasx in forum New To Java
    Replies: 2
    Last Post: 02-12-2009, 06:22 AM
  5. Revised Linked List printing method question
    By CirKuT in forum New To Java
    Replies: 7
    Last Post: 12-12-2008, 11:21 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
  •