0

How is collection class used?? Can someone explain???

20th Aug 2016, 1:08 AM
Pulkit Pant
Pulkit Pant - avatar
3 Antworten
+ 2
collection Class in java is a framwork That provides an architecture to store anstrengelser manipulate the groupe of objects. U use i to things like searching, insertion manipulation and deletion. In short words does the collection Class Means That it represents a single unit of objects i.e a groupe. Hope it helped :) and pless upvote :)
20th Aug 2016, 1:27 AM
Tony Sjeerback
Tony Sjeerback - avatar
0
Thanks... But i want implementation... Like a real life example...
20th Aug 2016, 6:41 AM
Pulkit Pant
Pulkit Pant - avatar
- 1
Collection is just an interface, extended by other interfaces like List and Set (which both have multiple concrete implementations) You may use the Collection-Type for your varaiable if you want to be completely decoupled from the concrete type, if you want to have some extra constraints (like unique values only) you set your variable to Set. You can pass your set to any method that wants a xollection, but you can not pass a collection to a method that wants to get a Set as argument. Just read a little bit about lose coupling in java...
20th Aug 2016, 8:38 AM
maisterlein