in Technology by
Explain various interfaces used in JAVA Collection framework ?

1 Answer

0 votes
by

JAVA Collection framework implements various interfaces, Collection interface and Map interface (java.util.Map) are the mainly used interfaces of Java Collection Framework. List of interfaces of Collection Framework is given below:

1. Collection interface: Collection (java.util.Collection) is the primary interface, and every collection must implement this interface.

Syntax:

  1. public interface Collection<E>extends Iterable  

Where <E> represents that this interface is of Generic type

2. List interface: List interface extends the Collection interface, and it is an ordered collection of objects. It contains duplicate elements. It also allows random access of elements.

Syntax:

  1. public interface List<E> extends Collection<E>  

3. Set interface: Set (java.util.Set) interface is a collection which cannot contain duplicate elements. It can only include inherited methods of Collection interface

Syntax:

  1. public interface Set<E> extends Collection<E>  

Queue interface: Queue (java.util.Queue) interface defines queue data structure, which stores the elements in the form FIFO (first in first out).

Syntax:

  1. public interface Queue<E> extends Collection<E>  

4. Dequeue interface: it is a double-ended-queue. It allows the insertion and removal of elements from both ends. It implants the properties of both Stack and queue so it can perform LIFO (Last in first out) stack and FIFO (first in first out) queue,operations.Syntax:

  1. public interface Dequeue<E> extends Queue<E>  

5. Map interface: A Map (java.util.Map) represents a key, value pair storage of elements. Map interface does not implement the Collection interface. It can only contain a unique key but can have duplicate elements. There are two interfaces which implement Map in java that are Map interface and Sorted Map.

Related questions

0 votes
    Which of these keywords is used to define interfaces in Java? (a) interface (b) Interface (c) intf (d) ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these classes is not part of Java's collection framework? (a) Maps (b) Array (c) Stack (d ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of this interface is not a part of Java's collection framework? (a) List (b) Set (c) SortedMap ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What are the important interfaces of Hibernate framework?...
asked Feb 4, 2021 by JackTerrance
0 votes
    Which of these keywords is used to define interfaces in Java? (a) interface (b) Interface (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of these classes is not part of Java's collection framework? (a) Maps (b) Array (c) Stack ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of this interface is not a part of Java's collection framework? (a) List (b) Set (c) ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which is the new method introduced in java 8 to iterate over a collection? (a) for (String i : StringList) ... & Miscellaneous of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    a java api collections of prewritten packages classes and interfaces with their respective methods and construction true ... or false Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    a java api collections of prewritten packages classes and interfaces with their respective methods and construction true ... or false Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    Explain various transalator used in high level language? also in very short Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    Name popular Java Framework that is used to develop microservices. 1. Spring boot 2. Spring cloud 3. Eclipse MicroProfile 4. Both B and C 5. Both A and C...
asked Jul 25, 2021 in Technology by JackTerrance
0 votes
    Which of these packages contains all the event handling interfaces? (a) java.lang (b) java.awt (c) java.awt ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these interfaces handles the event when a component is added to a container? (a) ComponentListener (b) ... Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these interfaces define a method actionPerformed()? (a) ComponentListener (b) ContainerListener (c) ... of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
...