English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
في هذا الدليل، سنتعلم عن واجهة Collection في Java وواجهات الفرعية الخاصة بها.
واجهة Collection هي واجهة جذور إطار العمل الخاص بالجمعيات في Java.
لا يتم تنفيذ هذه الواجهة مباشرة. ولكن يتم تنفيذها من خلال واجهات الفرعية (مثل List، Set و Queue).
على سبيل المثال، تقوم فئة ArrayList بتنفيذ واجهة List، وهي واجهة فرعية لواجهة Collection.
كما ذكرت سابقًا، واجهة Collection تشمل واجهات الفرعية التي يتم تنفيذها بواسطة أنواع مختلفة من Java.
واجهة List هي مجموعة منضوية تسمح لنا بإضافة وإزالة العناصر مثل اللوحة. للحصول على مزيد من المعلومات، يرجى زيارةJava List Interface
The Set interface allows us to store elements in different collections, similar to sets in mathematics. It cannot have duplicate elements. For more information, please visitJava Set واجهة
When we want toFirst In First Out (FIFO)When storing and accessing elements, you can use the Queue interface. For more information, please visitواجهة Queue Java
The Collection interface includes various methods that can be used to perform different operations on objects. These methods are available in all of its sub-interfaces.
add() - Insert the specified element into the collection
size() - Return the size of the collection
remove() - Delete the specified element from the collection
iterator() - Return an iterator to access the elements of the collection
addAll() - Add all elements from the specified collection to the collection
removeAll() - Delete all elements from the specified collection from the collection
clear() - Delete all elements from the collection