With respect to the following two different definitions of sets, what are the differences:
Set<Integer> intset = new Hashset<Integer>();
Set<Integer> intset = new Set<Integer>();
Thanks.
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 declare new Set its an interface. All of those(Set, Map, List) are interfaces the java.collections package. They are not directly instantiable, but require that implementations(HashSet, ArrayList, Hashmap) be supplied in the right hand side of the assignment operation.