aspose file tools*
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 Java 8 in Action this week in the Java 8 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: 9280
    
  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: 9280
    
  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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: What does it mean
 
Similar Threads
Generics and Overriding
Overriding and Overloading
Overriding generic methods
generic erasure
Can Any One Explain Me The Following Codes Briefly