Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to Get Type's Class of a Collection

PatchaJan 25 2012 — edited Jan 25 2012
Hi all,
I just wanna ask if there is a simple way to get the type's Class of a Collection.

For example, for an ArrayList<String> or List<Integer> objects, how do I dynamically get "String" or "Integer" Class object (expecially with generic types) without making strange sequences of reflections?

Thank you!
This post has been answered by 452196 on Jan 25 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2012
Added on Jan 25 2012
14 comments
2,033 views