In HashSet duplicates are allowed while adding to the HashSet,
but while retreiving the object from HashSet is not shown the
duplicate values, WHY ?
Answers were Sorted based on User's Feedback
Answer / brijendra kumar (xavient)
Actually in HashSet we are able to add the duplicate value,
but at the execution time JVM ignore the duplicate value.
HashSet<String> T= new HashSet<String>();
T.add("k");
T.add("k");
System.out.println("size" +T.size());
when we execute these line of code then we got the size of
HashSet is 1.
Due to this reason we are unable to iterate the duplicate
value from HashSet.
| Is This Answer Correct ? | 7 Yes | 2 No |
Answer / shashi
Because HashSet class will override equals and hashcode method internally.
| Is This Answer Correct ? | 0 Yes | 0 No |
I have include a jsp page by using <jsp:include page="/.../xyz.jsp"/> The thing is that the xyz.jsp page has its submit button.When i click on that button the whole main page get refreshed.But i want to refresh only the xyz.jsp page.How could i achive it so that i can only refresh the xyz.jsp not the main page page?
what are advantages of HQL? what are advantages of Native SQL? what are advantages of Criteria API?
what are callback methods?
HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS
What is the enumerator of the java collection framework? : java collections
What are the queues in the java collection framework? : java collections
what is jndi?
What are the uses of the set interfaces in the java collections? : java collections
What are the different types of ways where you can iterate over a list? : java collections
How do you create UserTransaction Object? How do you rollback a transaction in a method?
what is difference between business deligate and session facade ?
How do I find jre path in windows?