Список интерфейс является расширением интерфейса коллекции. Список интерфейса указывает поведение коллекции объектов. Это позволяет дублирующие объекты и один или более элементов, являются недействительными.
Полезные методы Список Интерфейс:
Method |
Usage |
add() |
Adds an |
clear() |
Removes all objects from the |
contains() |
Returns true if a special object |
get() |
Returns the element at the |
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
Usage
add()
Adds an
objects to the collection
clear()
Removes all objects from the
collection.
contains()
Returns true if a special object
is an element with in the collection.
get()
Returns the element at the
specified index position in this collection.
isEmpty()
Returns true if the collection
has no elements.
listIterator()
Returns a ListItertor object for
the collection which may then be used to retrieve an object.
Remove()
Removes the element at the
specified index position in this collection.
size()
Returns the number of elements
in the collection.
add()
Adds an
objects to the collection
clear()
Removes all objects from the
collection.
contains()
Returns true if a special object
is an element with in the collection.
get()
Returns the element at the
specified index position in this collection.
isEmpty()
Returns true if the collection
has no elements.
listIterator()
Returns a ListItertor object for
the collection which may then be used to retrieve an object.
Remove()
Removes the element at the
specified index position in this collection.
size()
Returns the number of elements
in the collection.
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
Adds an |
|
clear() |
Removes all objects from the |
contains() |
Returns true if a special object |
get() |
Returns the element at the |
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
|
clear() |
Removes all objects from the |
contains() |
Returns true if a special object |
get() |
Returns the element at the |
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
Removes all objects from the |
contains() |
Returns true if a special object |
get() |
Returns the element at the |
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
|
contains() |
Returns true if a special object |
get() |
Returns the element at the |
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
Returns true if a special object |
get() |
Returns the element at the |
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
|
get() |
Returns the element at the |
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
Returns the element at the |
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
|
isEmpty() |
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
Returns true if the collection |
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
|
listIterator() |
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
Returns a ListItertor object for |
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
|
Remove() |
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
Removes the element at the |
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
|
size() |
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
Returns the number of elements |
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
import
|
В этом коде ListIterator используется для чтения объекты в списке. Он позволяет считывать объекты из коллекции как в прямом и обратном направлениях.
|
Вывод на экран:
The collection has 5objects Forward Reading Object 1 Object 2 Object 3 Object 4 Object 5 Backward Reading Object 5 Object 4 Object 3 Object 2 Object 1