is the default value for generics.

the example you quoted says

the compiler will automatically help us determine the type of T based on the passed parameters

while in JQueryStatic , the passed parameter has nothing to do with TElement . In other words, it cannot be inferred automatically. At this point, you can specify a default value.

< hr >

the example quoted by the subject says "incoming parameter", so I followed this loose expression, but it seemed to lead to confusion.

the "incoming parameter" here refers to what is in parentheses, that is, the formal parameter of the function. If TElement does not appear in parentheses, it is impossible to automatically infer generics based on the arguments at the time of the call. As for the constraints of generics, they can appear at the same time as the default value or at different times, and there is no inevitable relationship between the two.

strictly speaking, the word "incoming" cannot be matched with the word "generic parameter". Generics are used at definition time, and the runtime is removed.

add an example:

  

Thank you, boss, for solving the confusion

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf192e-31d8f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf192e-31d8f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?