Java Spliterator hasCharacteristics() Method

The hasCharacteristics() is a method of Java Interface Spliterator which returns true if this Spliterator's characteristics() contain all of the given characteristics.

Syntax

Following is the declaration of hasCharacteristics() method-

Parameter

DataTypeParameterDescriptionRequired/Optional
intcharacteristicsIt is the characteristics to check for.Required

Return

The hasCharacteristics() method returns true if all the specified characteristics are present in the invoking spliterator, otherwise returns false.

Exceptions

NA

Compatibility Version

Java 1.8 and above

Example 1

Output:

hasCharacteristics Present? : true

Example 2

Output:

DISTINCT
SIZED