e.g.
public interface CacheClient
{
List<?> getKeysWithExpiryCheck();
}
Or should I return
List<Object>
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.
Here is a good intro to Java Generics. [A] and [B] explain the difference between ? and Object. Basically, ? indicates that the type is unknown which is a problem if you need to add items to the list. However, if you only read from the list it is OK to treat the result as an Object. Although, I suggest to use some thing like
[A] http://java.sun.com/docs/books/tutorial/extra/generics/subtype.html
[B] http://java.sun.com/docs/books/tutorial/extra/generics/wildcards.html