wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What does it mean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What does it mean" Watch "What does it mean" New topic
Author

What does it mean

Harpreet Singh janda
Ranch Hand

Joined: Jan 14, 2010
Posts: 317

This example is from Niko's blog



What does <T> means here?

say is not returning anything as its void method.

Can anybody please explain?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Here <T> is the type declaration for the method which is unused as the method neither accepts parameters of type <T> nor does it return a value of type <T>...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Harpreet Singh janda
Ranch Hand

Joined: Jan 14, 2010
Posts: 317

Then what is the use of this?
Anbarasu Aladiyan
Ranch Hand

Joined: Jun 02, 2009
Posts: 182

read it from here.


A.A.Anbarasu
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Harpreet Singh janda wrote:Then what is the use of this?

In this particular example, there is no use of the generic type. It is just done that way to make the question a little confusing...
Anbarasu Aladiyan
Ranch Hand

Joined: Jun 02, 2009
Posts: 182

Ankit Garg wrote:
Harpreet Singh janda wrote:Then what is the use of this?

In this particular example, there is no use of the generic type. It is just done that way to make the question a little confusing...

I did not post that link for an example. i gave that link to know more about generics.

We may say
you must declare the type variable BEFORE the return type of the method
but it will become much confusing again.
 
 
subject: What does it mean
 
Similar Threads
Generics and Overriding
Overriding generic methods
generic erasure
Overriding and Overloading
Can Any One Explain Me The Following Codes Briefly