Results 1 to 3 of 3
  1. #1
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Location
    Turkey
    Posts
    380
    Blog Entries
    24
    Rep Power
    3

    Default return value of the Collections.addAll

    The method addAll is shown as:

    public static <T> boolean addAll(Collection<? super T> c,
    T... a)

    in the API.

    So it is a public and static method.

    Returns a <T> which is some sort of Container...

    What does boolean stand for after the <T> ?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,882
    Rep Power
    8

    Default Re: return value of the Collections.addAll

    That <T> is not a return value. Recommended reading: Generic Methods (The Java™ Tutorials > Bonus > Generics)
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    5

    Default Re: return value of the Collections.addAll

    Quote Originally Posted by fatabass View Post

    Returns a <T> which is some sort of Container...
    Thats wrong! Read the API Doc (and generic tutorials!)
    -->
    Collections (Java Platform SE 6)
    true if the collection changed as a result of the call

Similar Threads

  1. Collections
    By NatureFreshMilk in forum New To Java
    Replies: 12
    Last Post: 05-23-2011, 08:12 AM
  2. addAll method in List
    By yma16 in forum New To Java
    Replies: 1
    Last Post: 04-10-2011, 09:23 PM
  3. Collections help.
    By YoungJavaBoy in forum New To Java
    Replies: 3
    Last Post: 03-14-2011, 11:14 PM
  4. Help collections
    By nikosv in forum New To Java
    Replies: 8
    Last Post: 12-13-2010, 05:29 PM
  5. Collections
    By Cbani in forum New To Java
    Replies: 3
    Last Post: 02-16-2010, 02:46 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
  •