1

I want to check the type of object (String, ArrayList, int) that was passed into a java generic. How can I do this?

Serket
  • 3,785
  • 3
  • 14
  • 45
  • 1
    You can't. These types are not available at runtime. That is called type erasure. – f1sh Jul 22 '20 at 14:19
  • Can you show the code where you need this? You know you can call `getClass` on any object right? – Joni Jul 22 '20 at 14:20

0 Answers0