Java class documentation question. <E> <T> <K,V>

P

PatFan15

I am new to Java and I am reviewing the online class documentation from
Sun. I have come across something that I cannot decipher.

I am sure I probably overlooked something and will feel stupid for
asking this once I hear the answer, but I can't seem to find an
explanation.

In the documentation for the java.lang package, there are the following
classes/interfaces listed.
Comparable<T>
Iterable<T>
ThreadLocal<T>

java.util has these among others
Collection<E>
Comparator<T>


What do the <T> and the <E> and the <K,V> mean?

They look like parameters, but I do not recognize the format. If this
is part of a standard documentation format, please feel free to point
me to some documentation on the format and I can read up on it myself.
Thanks.
 
T

Tony Morris

PatFan15 said:
I am new to Java and I am reviewing the online class documentation from
Sun. I have come across something that I cannot decipher.

I am sure I probably overlooked something and will feel stupid for
asking this once I hear the answer, but I can't seem to find an
explanation.

In the documentation for the java.lang package, there are the following
classes/interfaces listed.
Comparable<T>
Iterable<T>
ThreadLocal<T>

java.util has these among others
Collection<E>
Comparator<T>


What do the <T> and the <E> and the <K,V> mean?

They look like parameters, but I do not recognize the format. If this
is part of a standard documentation format, please feel free to point
me to some documentation on the format and I can read up on it myself.
Thanks.

They are 'parameterized types'.
http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top