Collections in java is a framework that provides an architecture
to store and manipulate the group of objects. Collection is use to represent a
group of individual object in java.
What is Collection Framework In Java?
Collection Framework in java is a centralized and unified
theme to store and manipulate the group of objects. Java Collection
Framework provides some pre-defined classes and interfaces to handle the
group of objects. Using collection framework, you can store the objects as
a list or as a set or as a queue or as
a map and perform operations like adding an object or removing
an object or sorting the objects without much hard work.
Collections Framework hierarchy
Methods of Collection interface
Collection interface contains total 15 abstract methods. 14 of it’s own and one is inherited from Iterable interface. Here is the list and descriptions of those methods.
No.
|
Method
|
Description
|
1
|
public
boolean add(Object element)
|
is
used to insert an element in this
collection.
|
2
|
public
boolean addAll(Collection c)
|
is
used to insert the specified collection
elements in the invoking collection.
|
3
|
public
boolean remove(Object element)
|
is
used to delete an element from this
collection.
|
4
|
public
boolean removeAll(Collection c)
|
is
used to delete all the elements of
specified collection from the invoking
collection.
|
5
|
public
boolean retainAll(Collection c)
|
is
used to delete all the elements of
invoking collection except the specified
collection.
|
6
|
public
int size()
|
return
the total number of elements in
the collection. |
7
|
public
void clear()
|
removes
the total no of element from
the collection. |
8
|
public
boolean contains(Object element)
|
is
used to search an element.
|
9
|
public
boolean containsAll(Collection c)
|
is
used to search the specified collection
in this collection.
|
10
|
public
Iterator iterator()
|
returns
an iterator.
|
11
|
public
Object[] toArray()
|
converts
collection into array.
|
12
|
public
boolean isEmpty()
|
checks
if collection is empty.
|
13
|
public
boolean equals(Object element)
|
matches
two collection.
|
14
|
public
int hashCode()
|
returns
the hashcode number for
collection. |
van
ReplyDeleteerzincan
sivas
ağrı
manisa
12J
görüntülüshow
ReplyDeleteücretli show
6YYT
Ağrı Lojistik
ReplyDeleteÇorlu Lojistik
Kars Lojistik
Antalya Lojistik
Rize Lojistik
761Y3
8C901
ReplyDeleteBurdur Evden Eve Nakliyat
Burdur Parça Eşya Taşıma
Hatay Evden Eve Nakliyat
Trabzon Lojistik
Tunceli Parça Eşya Taşıma
9D347
ReplyDeleterastgele sohbet
şırnak canlı sohbet bedava
artvin canli sohbet bedava
kırıkkale canlı sohbet ücretsiz
kocaeli rastgele sohbet siteleri
manisa ücretsiz sohbet sitesi
kütahya en iyi ücretsiz görüntülü sohbet siteleri
diyarbakır en iyi sesli sohbet uygulamaları
canlı sohbet et
87C7E
ReplyDeletezonguldak canlı sohbet sitesi
burdur sesli sohbet siteleri
mobil sohbet siteleri
parasız görüntülü sohbet uygulamaları
Kocaeli Görüntülü Sohbet Siteleri
bingöl canlı sohbet sitesi
Bilecik Sohbet Sitesi
erzincan chat sohbet
Şırnak Sohbet Odaları
CBB67
ReplyDeletezkswap
eigenlayer
DefiLlama
dappradar
thorchain
uniswap
layerzero
shapeshift
quickswap