JAVA
2.7K subscribers
73 photos
111 files
76 links
Download Telegram
Enumeration returned by ArrayList is
Anonymous Quiz
43%
Fail-fast
48%
Fail-safe
10%
None of the above
The Comparator interface contains the method?
Anonymous Quiz
27%
compareWith()
45%
compareTo()
27%
compare()
What will Collections.sort internally uses when number of elements are less than 7?
Anonymous Quiz
28%
Insertion sort
22%
Merge sort
50%
Quick sort
What do Collections.sort internally uses once a number of elements are greater than 7?
Anonymous Quiz
22%
Insertion sort
44%
Merge sort
33%
Quick sort
An attempt to add null key to a TreeMap will result in:
Anonymous Quiz
22%
Compile time Exception
17%
Error
61%
Runtime - NullPointerException
What will be the output of the following code -
import java.util.Map;
import java.util.TreeMap;
public class TreeMapTest
{
public static void main(String[] args) {
Map<Integer,String> m=new TreeMap<Integer,String>();
m.put(11,"audi");
m.put(null,null);
m.put(11,"bmw");
m.put(null,"fer");
System.out.println(m.size());
System.out.println(m);
}
}
Which of those is synchronized and does not allow null elements?
Anonymous Quiz
48%
Vector
14%
CopyOnWriteArraySet
19%
CopyOnWriteArrayList
19%
ConcurrentSkipListSet
Which of these is synchronised and isn't sorted by natural order?
Anonymous Quiz
17%
EnumSet
33%
LinkedList
21%
ConcurrentSkipListSet
29%
Vector
public class Program
{
int i=10; static int x=i; public static void main(String[] args) { if(x==i){System.out.println("equal");} else if(x>i){System.out.println("Greater Than");} else{System.out.println("Less Than");} } }
Anonymous Quiz
22%
Equal
33%
Greater than
17%
Less Than
28%
Compile time error
public class Program
{
public static void main(String[] args) { if(System.out.printf("JAVAQuestionBank")==null){ System.out.println("i know java"); } else System.out.println("I KNOW JAVA"); } }
Anonymous Quiz
19%
i know java
62%
I KNOW JAVA
10%
JAVAQuestionBankI KNOW JAVA
10%
JAVAQuestionBanki know java