Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java generics, how do you say it when reading code out loud? [closed]

Tags:

java

generics

Just wondering, how would you read out loud the following items using generic types?

    1) class Box<T>  
    2) Box<Integer> integerBox  
    3) class Box<T,U>  
    4) <T,U> void doSomething(T t, U u)  

Thanks

like image 358
JavaMonkey22 Avatar asked Dec 12 '22 21:12

JavaMonkey22


1 Answers

1) class Box<T>                Box of T
2) Box<Integer> integerBox     Box of Integer
3) class Box<T,U>              Box of T,U
4) <T,U> void doSomething(T t, U u)  Just a method which accepts two type parameters T and U

References:

  • Generics Tutorial
  • Java Generics FAQs - Frequently Asked Questions
like image 60
Amit Deshpande Avatar answered May 23 '23 07:05

Amit Deshpande