V
V
vaniapooh2012-08-25 19:19:26
Java
vaniapooh, 2012-08-25 19:19:26

Unusual signature of java.util.ArrayList.toArray(T[]) method

The signature of the specified method is: public <T> T[] toArray(T[] a) . T[] is the return type. The question is - what does <T> mean, what is it called and what is the meaning of it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jorikburlakov, 2012-08-25
@jorikburlakov

Honestly, everything can be found through search engines.
Here is a description and an example of the application of the method.
Can't use search engines

S
ScratchBoom, 2012-08-25
@ScratchBoom

It's called Generic Methods
docs.oracle.com/javase/tutorial/extra/generics/methods.html

E
eugenius_nsk, 2012-08-26
@eugenius_nsk

Here is a good introduction to generics - www.rsdn.ru/article/java/genericsinjava.xml

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question