Results 1 to 2 of 2
  1. #1
    mahtab is offline Member
    Join Date
    Nov 2009
    Posts
    1
    Rep Power
    0

    Default class Declaration

    Please describe for me what's the meaning of this statement, I mean I dont understand <T extends A> in class declaration.

    public abstract class B<T extends A>{
    }

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    It's explained in Sun's Tutorial in the section on Bounded Type Parameters. The discussion there centers around a method, but the idea is similar.

    class B is generic. Like java.util.List where you can have List<String> for a list of strings and List<Number> for a list of numbers. In a similar way you can have B<Foo> for a B of Foo things. The point about extends is that Foo must extend A in order to be used in this way.

Similar Threads

  1. Database declaration
    By simontkk2005 in forum JDBC
    Replies: 4
    Last Post: 12-08-2009, 04:40 PM
  2. whats wrong with this class declaration?
    By blossompark in forum New To Java
    Replies: 5
    Last Post: 11-30-2008, 02:18 AM
  3. Declaration
    By asifahmed in forum New To Java
    Replies: 1
    Last Post: 04-05-2008, 05:38 AM
  4. JSP Declaration Directive
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-10-2007, 05:42 PM
  5. Function declaration problem.
    By snooze-g in forum Advanced Java
    Replies: 3
    Last Post: 07-18-2007, 09:15 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
  •