Results 1 to 8 of 8
  1. #1
    subith86 is offline Senior Member
    Join Date
    Jan 2011
    Location
    Bangalore, India
    Posts
    102
    Rep Power
    0

    Question doubt regarding <type parameter>

    I am familiar with Objects as type parameters, for example
    ArrayList<String, Integer>
    TreeSet<Object>

    But now I encountered a code like shown below
    Java Code:
    interface Dog<E extends Animal>
    What does <E extends Animal> type means? Is the type having properties of both E and Animal as in the case of normal inhertiance?

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    It is generic. It mean that you can use a all class, which extends Animal. and it all.
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    subith86 is offline Senior Member
    Join Date
    Jan 2011
    Location
    Bangalore, India
    Posts
    102
    Rep Power
    0

    Question

    you can use a all class, which extends Animal
    Is it ALL classes which extends Animal or Class E and Animal alone?

  4. #4
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    )) So. How you think what is class E?
    Skype: petrarsentev
    http://TrackStudio.com

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,953
    Rep Power
    19

  6. #6
    subith86 is offline Senior Member
    Join Date
    Jan 2011
    Location
    Bangalore, India
    Posts
    102
    Rep Power
    0

    Default

    Thanks Troll,

    I was confused with E. Even when I googled generics I could see lot of "E"s.;)
    I'll make this thread SOLVED.

  7. #7
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    5

    Wink

    Quote Originally Posted by subith86 View Post
    Thanks Troll,
    He isn't a Troll. It's Tolls.

    This is Funny. :D
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  8. #8
    subith86 is offline Senior Member
    Join Date
    Jan 2011
    Location
    Bangalore, India
    Posts
    102
    Rep Power
    0

Similar Threads

  1. Subclass name to be a parameter?
    By Peetahzee in forum New To Java
    Replies: 6
    Last Post: 12-12-2009, 03:51 PM
  2. using instanceof to get Object type and parent type?
    By xcallmejudasx in forum New To Java
    Replies: 2
    Last Post: 11-06-2008, 06:24 PM
  3. [SOLVED] Cast string type to int type
    By GilaMonster in forum New To Java
    Replies: 9
    Last Post: 09-17-2008, 10:43 AM
  4. Retrieving a parameter through URL.
    By hisouka in forum Java Servlet
    Replies: 1
    Last Post: 09-06-2008, 12:45 PM
  5. passing an enum type as a parameter ??!
    By SCS17 in forum New To Java
    Replies: 11
    Last Post: 07-13-2008, 01:44 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
  •