Possible Duplicate:
How do I find out what type each object is in a ArrayList<Object>?
Knowing type of generic in Java
How can I retrieve the Type Foo from my ArrayList using the reflection in Java?
ArrayList<Foo> myList = new ArrayList<Foo>();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t get this type from the value, but you can get it from the Field information.
prints
Fields, method arguments, return types and extended classes/interfaces can be inspected, but not local variables or values
These produce the same result.
You cannot obtain a generic type for