Results 1 to 4 of 4
Like Tree4Likes
  • 1 Post By KevinWorkman
  • 3 Post By jim829

Thread: "Iterable<? extends String> arguments"

  1. #1
    anup1pma is offline Member
    Join Date
    Jul 2014
    Posts
    2
    Rep Power
    0

    Question "Iterable<? extends String> arguments"

    Hi, This is used as a parameter of a java program. can any one please explain this.

    Thanks

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,040
    Rep Power
    10

    Default Re: "Iterable<? extends String> arguments"

    Those are generics. Recommended reading: Lesson: Generics (The Java™ Tutorials > Bonus)

    If you have a more specific question, tell us which part of the code you posted confuses you.
    anup1pma likes this.
    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
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,030
    Rep Power
    6

    Default Re: "Iterable<? extends String> arguments"

    You picked an interesting example. The ? extends String means that you can iterate over some collection of type String or its subclasses. What makes it interesting is that String can't be subclassed since it is declared final.

    Regards,
    Jim
    gimbal2, anup1pma and JosAH like this.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  4. #4
    anup1pma is offline Member
    Join Date
    Jul 2014
    Posts
    2
    Rep Power
    0

    Default Re: "Iterable<? extends String> arguments"

    thanks, I will read this :)

Similar Threads

  1. Replies: 2
    Last Post: 11-15-2012, 05:20 PM
  2. Replies: 3
    Last Post: 10-30-2012, 04:06 PM
  3. Replies: 1
    Last Post: 05-07-2012, 06:35 PM
  4. "extends" and "implements"
    By newbie101 in forum New To Java
    Replies: 6
    Last Post: 02-27-2012, 03:12 PM
  5. Replies: 0
    Last Post: 04-02-2009, 08:02 PM

Tags for this Thread

Posting Permissions

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