-
-
-
-
-
-
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?">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?
-
-
-
-
-
What are differences between DIV and SPAN?
DIV is used to select a block of text so that one can apply styles to it. SPAN is used to select inline text and let users to apply styles to it. The main difference between DIV and SPAN is SPAN does not do formatting by itself. Also the DIV tag is used as a paragraph break as it creates a logical division of the document in which it is applied. This is in contrast to the SPAN as SPAN simply dos the...