public static java.util.List getFoo(java.lang.String)
The above method returns a List<String>, but the javap command returns the above (it doesn’t show that the List is of type String). Is there a way to show the real type?
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.
The type is a lie 🙂 Well seriously, that’s just compile time information. The entries of the list are casted to Strings when fetched from the collection, the list itself in bytecode format acts as any standard plain old List.
http://download.oracle.com/javase/tutorial/java/generics/erasure.html