English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

تعليميات Java الأساسية

تحكم العملية في Java

Java Arrays

Java Object-Oriented (I)

Java Object-Oriented (II)

Java Object-Oriented (III)

معالجة الاستثناءات Java

Java List (القائمة)

Java Queue (الطابور)

مجموعات Java Map

مجموعات Java Set

مدخلات ومخرجات Java (I/O)

قراء/كتابة Java

مواضيع أخرى في Java

واجهات المجموعات (Collection) Java

في هذا الدليل، سنتعلم عن واجهة Collection في Java وواجهات الفرعية الخاصة بها.

واجهة Collection هي واجهة جذور إطار العمل الخاص بالجمعيات في Java.

لا يتم تنفيذ هذه الواجهة مباشرة. ولكن يتم تنفيذها من خلال واجهات الفرعية (مثل List، Set و Queue).

على سبيل المثال، تقوم فئة ArrayList بتنفيذ واجهة List، وهي واجهة فرعية لواجهة Collection.

واجهات فرعية Collection

كما ذكرت سابقًا، واجهة Collection تشمل واجهات الفرعية التي يتم تنفيذها بواسطة أنواع مختلفة من Java.

1. واجهة List

واجهة List هي مجموعة منضوية تسمح لنا بإضافة وإزالة العناصر مثل اللوحة. للحصول على مزيد من المعلومات، يرجى زيارةJava List Interface

2. Set 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 واجهة

3. Queue Interface

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

Collection Methods

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