Was ist die Notwendigkeit eines Sammlungsframeworks in Java?

Sachinbhatt

Mitglied
What does the collection system in Java need, since all information operations (sorting/adding/deleting) are conceivable with arrays and additional clusters make sense for memory use and the execution is also better contrasted and collections.

Could someone give me a running information model showing the difference between these two executions (array/collections).
 
Array have very limited functionality.

It is a simple, object oriented, approach to create classes that implement the required functinality.
==> So you have different classes with difference functionality e.g. elements have an order or not, one element can be stored inside multiple times or not, .... So you have List, Set, Map, ....
This point also includes that an array only offers very limited, low level functionality.

A second important thing is hiding implementation details and having functionality independend of an implementation
==> You get Interfaces (e.g. List) which simply describes the functionality and then you can have multiple implementations e.g. ArrayList (which is using Arrays inside) or LinkedList or ....
 
Array have very limited functionality.

It is a simple, object oriented, approach to create classes that implement the required functinality.
==> So you have different classes with difference functionality e.g. elements have an order or not, one element can be stored inside multiple times or not, .... So you have List, Set, Map, ....
This point also includes that an array only offers very limited, low level functionality.

A second important thing is hiding implementation details and having functionality independend of an implementation
==> You get Interfaces (e.g. List) which simply describes the functionality and then you can have multiple implementations e.g. ArrayList (which is using Arrays inside) or LinkedList or ....
Thank you for your support, it was easy to understand!
 

Neue Themen


Zurück
Oben