• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

What does the symbols < ... > mean?

I know it's the greater and less than in mathematical symbols but in programming as a set such as the curly braces {} means a group/block of code,() is the set used as parameters/declarations passed to the block what does < class > exactly describes the meaning of what process?
I searched a couple ebooks on android and kotlin and the internet and this forum and I don't know what these symbols actually represent
 
Upvote 0
Code:
RecyclerView.Adapter<CrimeHolder>

Means that you are using a "Generic class". It's quite a lengthy thing to explain, but the concept is that in Java/Kotlin, you can define a class which acts on objects of a certain type. An example is a List class, which may possibly contain lots of different things. With generic types or "parameterized types", you can pin this down to more specific level. Before the language introduced this feature, a List would be declared to hold any type of Object. But with a generic class, you can declare this

Code:
List<Integer> myList;

which tells the compiler that myList can ONLY hold objects of type 'Integer'. Not String or Elephant, or anything else.
If you try to put anything in that list other than an Integer object, the compiler will yell very loudly at you to not do that :)
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones