• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use different Java types  RSS feed

 
Dustin Schreader
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm looking at some code that I may use in my program to look up a customers ID number and I want to do a search to check if the number is in the file before it tries to return the ID and customers info. I know <T> but I didn't know it could be used for other things like <Video> Can someone explain what is going on in this set of code? I mainly want to know how one would <random thing> make that work and what it does.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those things between angle brackets are called generics.

Have a look at this tutorial: Lesson: Generics
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!