Why do generics often use T?

前端 未结 8 869
故里飘歌
故里飘歌 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:16

    If your generic type represents something special, you can make it more precise.. Usually prefixing it with T : IRepository, SomeCollection ..

提交回复
热议问题