TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Automation/ Java Tutorials

Java Collection Framework

Introduction

The Collection interface is the root interface in the Java collection hierarchy. A collection represents a group of objects, called elements. This interface is used to pass collections around and manipulate them where general processing is required. The main collection interfaces in the Java collection framework are as follows.

  • Collection
  • Set
  • List
  • Queue
  • Map

All the interfaces are in java.util package. We can import them into your program as:

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;

 

 

Java Collection Framework

Set

A Set is a collection that contains no duplicate elements. We can use the Set collection when the objects in the collection do not contain duplicates for example playing cards.

public interface Set<E> extends Collection<E>

List

A List is an ordered collection also known as a sequence. Unlike Set, the list can contain duplicate elements in the collection.

public interface List<E> extends Collection<E>

Queue

A Queue collection is designed for holding elements prior to processing with some operations.

public interface Queue<E> extends Collection<E>

Map

A Map is used to map keys to values. A map cannot contain duplicate keys; and each key can map to at most one value.

public interface Map<K, V>

 

—

Java Tutorials

Java Tutorial on this website:

https://www.testingdocs.com/java-tutorial/

For more information on Java, visit the official website :

https://www.oracle.com/java/

Related Posts

Emma Tool

Automation /

Code Coverage Tools

Download Greenfoot Windows

Java Tutorials /

Download & Install Greenfoot on Windows

Selenium 4 Automation Project

Automation /

Selenium 4 Project Setup on Ubuntu Linux

Java Tutorials /

Java Static Code Analysis

Testing webpage mobile-friendliness using a tool

Automation /

Testing webpage mobile-friendliness using a tool

‹ Java Automation Environment Setup› Object Oriented Programming Paradigm

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com