A very clear explanation.
Thank you a lot.


Mensaje citado por Efraín Gorfinkel <[EMAIL PROTECTED]>:

 Hi Ramiro,
 By using a generic method, we can declare the method without a specific type
 and then get the
 type information based on the type of the object passed to the method.
 The strangest thing about generic methods is that you must declare the type
 variable BEFORE the return type of the method.
 The <P> before P simply defines what P is before you use it as a type in the
 argument.
 Here you take an object of an unknown type and use a  "P" to represent the
 type
 The method will also returns an object of unknown type "P"

 HTH,
 Efrain.-
 www.linkedin.com/pub/dir/*efrain*/*gorfinkel*


 On Mon, Dec 1, 2008 at 1:03 PM, <[EMAIL PROTECTED]> wrote:

 >
 > Hi, can someone explain the following method signature:
 >
 > public <P> P myMethod(Parameter<P> p) {...
 >
 > Thanks !
 >
 >
 >  >
 >





--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to