Generic type parameter naming convention for Java (with multiple chars)?

Posted by chaper29 on Stack Overflow See other posts from Stack Overflow or by chaper29
Published on 2010-05-24T22:53:38Z Indexed on 2010/05/24 23:11 UTC
Read the original article Hit count: 118

Filed under:
|
|

In some interfaces i wrote I'd like to name generic type parameter with more than one character to make the code more readable.

Something like....

Map<Key,Value>

Instead of this...

Map<K,V>

But when it comes to methods, the type-parameters look like java-classes which is also confusing.

public void put(Key key, Value value)

This seems like Key and Value are classes. I found or thought of some notations, but nothing like a convention from sun or a general best-practice.

Alternatives i guesed of or found...

Map<KEY,VALUE>
Map<TKey,TValue>

© Stack Overflow or respective owner

Related posts about java

Related posts about generics