How to know the specific types of generics at run time

how to know the specific type of generics at run time:
for example: List < BaseDTO > list = new ArrayList < BaseDTO > ();
how to know the specific type of T in List at run time.

Jun.10,2021

list.forEach(value -> { System.out.println(value.getClass()) })

I don't know if it's what you want

Menu