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

    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
    New Zealand
    Rep Power


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