4

What is

Type<Type> type;

called (opposed to)

Type type;

You know, where you put the angle brackets around the type? I use this a lot, but don't know the name - it's bugging me. It's very hard to search for - Google ignores the <> characters.

(note: this is Java)

JohannesH
  • 6,430
  • 5
  • 37
  • 71
Isaac Waller
  • 32,709
  • 29
  • 96
  • 107

3 Answers3

13

Generics! :)

Noon Silk
  • 54,084
  • 6
  • 88
  • 105
9

Generics: http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html

Tyler
  • 21,762
  • 11
  • 61
  • 90
3

Generics or parameterized types.

(Hey, two people already posted the same thing as each other and both got ~3 upvotes. I'm just looking for a share of the love.)

Imagist
  • 18,086
  • 12
  • 58
  • 77
  • Why are there 2 different names? – Isaac Waller Aug 17 '09 at 03:38
  • Because I've seen both in usage, and I thought it might be helpful for the OP to know that they both mean the same thing. I also considered adding "templated types" since some C++ programmers call Java Generics that, but I decided not to because the differences (especially in how it's implemented) are significant. – Imagist Aug 17 '09 at 03:52