Import java.util.*;public class SetEx { private String str; SetEx(String s) { str = s } public static void main(String[] ar) { Set s = new HashSet(); SetEx setEx = new SetEx("Java"); SetEx setEx1 = new SetEx("Java"); String str1 = new String("Java"); String str2 = new String("Java"); s.add(setEx); s.add(setEx1); s.add(str1); s.add(str2); System.out.println("No Of elements in the Set is " + s.size()); }What is the result and how?

Questions by moorthimahalingam   answers by moorthimahalingam

Showing Answers 1 - 9 of 9 Answers

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions