A collection represents a group of objects, known as its elements. Some collections allow duplicate elements and others do not.
It provides implementations of more specific sub interfaces like Set and List.
The List interface extends Collection and declares the behavior of a collection that stores a sequence of elements.
Elements can be inserted or accessed by their position in the list, using a zero-based index.
A list may contain duplicate elements.
A Set is a Collection that cannot contain duplicate elements.
It provides implementations of more specific sub interfaces like Set and List.
The List interface extends Collection and declares the behavior of a collection that stores a sequence of elements.
Elements can be inserted or accessed by their position in the list, using a zero-based index.
A list may contain duplicate elements.
A Set is a Collection that cannot contain duplicate elements.
Array List supports dynamic arrays that can grow as needed.
Standard Java arrays are of a fixed length. After arrays are created, they cannot grow or shrink, which means that you must know in advance how many elements an array will hold.
Array lists are created with an initial size. When this size is exceeded, the collection is automatically enlarged. When objects are removed, the array may be shrunk.
hasNext() method Returns true if this scanner has another token in its input.
It returns Boolean values true and false
next() method finds and returns the next complete token from this scanner
Declaration
Following is the declaration for java.util.Scanner.next() method
public String next()
No comments:
Post a Comment