The first is to declare that the letter T represents a certain type (generic) in this method. Of course, you can also use E, K, A, etc. It is customary to use T, K, E more often.
The second uses the generic defined by this method as the return value.
Object...param means passing in one or more parameters of Object type. You can also say that you pass in an Object array
List
是泛型的写法。表示这是一个泛型方法,T
是参数类型。Object... params
is an indefinite parameter. You can pass one, multiple or no parameters. It can be regarded as an array.The former is a generic type, and the params parameter is an object array
The first is to declare that the letter T represents a certain type (generic) in this method. Of course, you can also use E, K, A, etc. It is customary to use T, K, E more often.
The second uses the generic defined by this method as the return value.
Object...param means passing in one or more parameters of Object type. You can also say that you pass in an Object array
No problem as mentioned above