Why do generics often use T?

前端 未结 8 868
故里飘歌
故里飘歌 2020-12-17 18:08

Is there any reason for the use of \'T\' in generics? Is it some kind of abbreviation? As far as I know, everything works. For example

public G Say         


        
相关标签:
8条回答
  • 2020-12-17 18:33

    T for Type, as like you said everything works fine.But putting T in that place remind you that is of generic type.

    0 讨论(0)
  • 2020-12-17 18:40

    I thought that was T for Template because it first appears in C++.

    0 讨论(0)
提交回复
热议问题