File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Associate Certification (SCJA,OCAJ 5/6) and the fly likes  importance of formal type parameters? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Associate Certification (SCJA,OCAJ 5/6)
Bookmark " importance of formal type parameters? " Watch " importance of formal type parameters? " New topic
Author

importance of formal type parameters?

Roshan Rai
Greenhorn

Joined: Aug 16, 2012
Posts: 15


what is the importance of formal type parameters..??

why are they used..??



please help...
thanks in advance..
Ankit Dan
Ranch Hand

Joined: Aug 31, 2012
Posts: 47

Suppose you have a non-generic method

now this is too general in the sense that it does not express any relationship between k and array this kind of dependency can be achieved using formal type parameter



so now when a generic method is called you can specify the E as you wish like Integer and hence k and array will be of type Integer, for example


this means the call signature is : iAmGeneric(Integer, Integer[])


i hope you got it

Ankit
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: importance of formal type parameters?