Generic bubblesort

T is used to make generic .What is T ? It is class or variable or anything else.

T is a special keyword (like main,int, scan etc) in the Java Documentation and is used to define generic classes. T is basically a placeholder for other data types when the data type is not known beforehand and is filled at run time by concrete data types like int,char. So it can be used to implement polymorphism.
For example, in a generic bubble sort function, depending on the data we provide at runtime, it can sort numbers, characters, decimals, integers etc.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.