• Post Reply Bookmark Topic Watch Topic
  • New Topic

The Letter 'T'  RSS feed

 
Ranch Hand
Posts: 30
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the letter 'T' mean in Enumeration<T> or Iterator<T> etc?
 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any type you'd like to use in the collection.

For example: List<String>
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a type parameter. See Generics in Oracle's Java Tutorials for more information.

By the way, it doesn't have to be the letter 'T', that's just a convention. Type parameters can have any name, it's just convention that a single, upper-case letter is used, often 'T' (for 'type').
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!