View Count: 0
Duration: 18 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 29 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 33 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 13 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 24 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Sorry!For this module there is no Sample Code.
Sorry!For this module there is no Assignments.
Question No: 1 of 10
What is Collection in Java? 
Options:
  1. A group of classes
  2. A group of classes and interfaces
  3. A group of interfaces
  4. None of the mentioned
View Answer/Explanation:
b
Explanation:

Question No: 2 of 10
Which interface provides the capability to store objects using a key-value pair? 
Options:
  1. Java.util.Collection
  2. Java.util.Set
  3. Java.util.List
  4. Java.util.Map
View Answer/Explanation:
d
Explanation:
An object that maps keys to values. A map cannot contain duplicate keys; each key can map to at most one value

Question No: 3 of 10
All collection classes in java.util package are implementation classes of different interfaces 
Options:
  1. true
  2. false
View Answer/Explanation:
a
Explanation:

Question No: 4 of 10
Which of these interface must contain a unique element? 
Options:
  1. Set
  2. List
  3. Array
  4. Collection
View Answer/Explanation:
a
Explanation:
Set interface extends collection interface to handle sets, which must contain unique elements.

Question No: 5 of 10
Which of these is Basic interface that all other interface inherits? 
Options:
  1. Set
  2. Array
  3. List
  4. Collection
View Answer/Explanation:
d
Explanation:
Collection interface is inherited by all other interfaces like Set, Array, Map etc. It defines core methods that all the collections like set, map, arrays etc will have

Question No: 6 of 10
Which of the following is synchronized? 
Options:
  1. Set
  2. LinkedList
  3. Vector
  4. WeakHashMap
View Answer/Explanation:
c
Explanation:
Vector is a type of collection object in java as it is used to implement AbstractList class.It is a synchronized method as it allows the means to run multiple threads and safely read/modify data from a vector at the same time.

Question No: 7 of 10
Which of these statements is true? 
Options:
  1. LinkedList extends List
  2. AbstractSet extends Set
  3. HashSet extends AbstractSet
  4. WeakHashMap extends HashMap
View Answer/Explanation:
c
Explanation:
Hashset implements the Set interface, which is in the hashtable and it an HashMap instance gets created. It doesn't gurantee the iteration order as well as consistency of the order over the period of time. It allows the null element to be used and passed to methods. HashSet provides constant time performance for the basic operations (add, remove, contains and size), assuming the hash function distributes the elements properly among the buckets.

Question No: 8 of 10
What is the output of this program? 
import java.util.*;
  class vector {
  public static void main(String args[]) {
   Vector obj = new Vector(4,2);
   obj.addElement(new Integer(3));
   obj.addElement(new Integer(2));
   obj.addElement(new Integer(5));
   obj.removeAll(obj);
   System.out.println(obj.isEmpty());
    }
  } 
Options:
  1. true
  2. false
  3. 0
  4. 1
View Answer/Explanation:
c
Explanation:
firstly elements 3, 2, 5 are entered in the vector obj, but when obj.removeAll(obj); is executed all the elements are deleted and vector is empty, hence obj.isEmpty() returns true

Question No: 9 of 10
What is the result of compiling and running the following program? 
Import java.util.ArrayList; 
import java.util.List;
public class Tester { 
public static void main(String[] args) {
List list1 = new ArrayList();//line 1  
List list2 = list1;//line 2
list2.add(new Integer(12));//line 3 
System.out.println(list2.size());//line 4 
}
} 
                                        Options:
                                        
  1. Compilation error at line 1, must initialize the size.
  2. Compilation error at line 2,Type mismatch, cannot convert from List to List
  3. Compilation error at line 3, can add objects of type String only
  4. 1
  5. View Answer/Explanation:
    b
    Explanation:
    Type mismatch, cannot convert from List to List
    Question No: 10 of 10
    Which of the following is a correct declaration and instantiation of list? 
    Options:
    1. List list =new ArrayList();
    2. List list = new ArrayList();
    3. List list = new ArrayList();
    4. all
    View Answer/Explanation:
    d
    Explanation:

      1