Set Interface

Advertisements

Prev Tutorial Next Tutorial

Set Interface in Java

Set is an Interface in java API which extends Collection Interface. It is used to store multiple objects with unique that means it do not allows to store duplicate elements. Set Interface are implemented in following collection classes.

  • HashSet
  • TreeSet
  • LinkedHashSet

Note: Set is based on Set in general mathematics which also do not store duplicate elements so here Set Interface do not allows to store duplicate elements.

Create object for Set Implementer classes

Syntax

Set_Implemented_class<generic_class> obj=new Set_Implemented_class<generic_class>();

Example to create object of HashSet

HashSet<String> obj=new HashSet<String>();

Prev Tutorial Next Tutorial

Advertisements

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Download Projects

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements