-
Users Count
How to count the number of users who logged on to a website?
-
Override Final Method
How to override final method?
-
ArrayList to Array
How will you convert an ArrayList to an Array?
-
Overriding Methods
Suppose a Super Class method throws an exception and this method is Overriden in the subclass with no exception. Now if you create a super class reference that has a subclass object. This throws a compile time error, Why?
-
Read Number Methods
How many methods to read numbers and characters and what should be used.
-
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?