O'Reilly logo

JAVA Programming by K. Rajkumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10

Set Containers

OBJECTIVES
  • To introduce implementations of Set interface
  • To check whether Sets allow duplicates
  • To introduce the add and remove operations on Sets
  • To introduce the union and difference operations on Sets
  • To develop counting duplicates application
  • To introduce LinkedHashSet’s insertion ordering
  • To introduce TreeSet’s red black tree implementation
10.1 INTRODUCTION

Sets are the third type of Java containers we are going to deal with in this book. Having seen Lists and Map types, we might have observed that lists and maps allow duplicate values. However there are many situations where we need to hold only unique elements. This is where sets score better. In this chapter, the readers will be introduced to Set interface ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required