JAVA
2.7K subscribers
73 photos
111 files
76 links
Download Telegram
Iterator returned by ConcurrentSkipListMap on key, value and entry is?
Anonymous Quiz
44%
Fail-fast
46%
Fail-safe
10%
None
Which Set implementation is sorted and synchronized?
Anonymous Quiz
36%
LinkedHashSet
27%
ConcurrentSkipListSet
27%
TreeSet
10%
CopyOnWriteArraySet
concurrentSkipListMap allows
Anonymous Quiz
26%
one null key
20%
many null values
43%
All
11%
None
Fill in the blank to compile the code successfully.
abstract class A{
int a=100;
public abstract void showA();
}
public class B extends A{
.............//Fill the blank
public static void main (String[] args){
A objA=new B();
objA.showA();
}
}
public class Program
{
int a;
boolean isTrue;
static int i;
public static void main(String[] args) {
Program p=new Program();
System.out.println(p.a);
System.out.println(p.isTrue);
System.out.println(p.i);
}
}
import java.util.HashSet;
import java.util.Set;
public class Program
{
public static void main(String[] args) {
Set hashSet = new HashSet();
hashSet.add("1");
hashSet.add(1);
hashSet.add(null);
hashSet.add("null");
System.out.println(hashSet);
}
}
public class Program
{
public static void main(String[] args) {
Super s=new SubClass();
s.foo();
}
}
class Super{
void foo(){
System.out.println("Super class");
}
}
class SubClass extends Super{
static void foo(){
System.out.println("SubClass");
}
}
What should we use get operations are more?
Anonymous Quiz
53%
ArrayList
31%
LinkedList
16%
Any
Complexity of ArrayList get method
Anonymous Quiz
21%
O(n-1)
41%
O(n)
29%
O(1)
9%
O(2n)
Which is sorted by natural order?
Anonymous Quiz
26%
LinkedHashSet
47%
TreeSet
20%
HashSet
7%
None
Which of these maintains insertion order?
Anonymous Quiz
51%
List
24%
Set
20%
All
5%
None
Which maintains insertion order?
Anonymous Quiz
29%
TreeSet
25%
HashSet
41%
LinkedHashSet
5%
None
Java HashMap with Realtime Examples
http://www.javachain.com/java-hashmap-with-examples/