CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2002
    Location
    Kerala
    Posts
    1,183

    What's Constructor<?>

    In the wikipedia page on the factory pattern


    What does Constructor<?> mean in the statement

    HashMap<String,Constructor<?>> factoryServices ?

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: What's Constructor<?>

    Constructor is a class in the java.lang.reflect package. Instances of this class represent a single constructor in another class and provide information about that constructor. They also allow access to the constructor so by using the newInstance(...) method you can create an object of the type the Constructor represents.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    Aug 2002
    Location
    Kerala
    Posts
    1,183

    Re: What's Constructor<?>

    Many thanks for your reply. I was wondering about the <?> , what does that mean ?

  4. #4
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: What's Constructor<?>

    It's a generics wildcard character meaning the constructor can be a constructor for an object of any type.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured