Loading...
Preparing your coding drills
Comprehensive reference for 51 Java methods across 6 categories.
add
Appends the specified element to the end of the list, or inserts it at the specified position.
get
Returns the element at the specified position in this list.
set
Replaces the element at the specified position with the specified element.
remove
Removes the element at the specified position or the first occurrence of the specified element.
size
Returns the number of elements in this list.
isEmpty
Returns true if this list contains no elements.
contains
Returns true if this list contains the specified element.
indexOf
Returns the index of the first occurrence of the specified element, or -1 if not found.
subList
Returns a view of the portion of this list between the specified indices.
toArray
Returns an array containing all elements in this list in proper sequence.
charAt
Returns the char value at the specified index.
substring
Returns a string that is a substring of this string.
split
Splits this string around matches of the given regular expression.
toLowerCase
Converts all characters in this string to lowercase.
toUpperCase
Converts all characters in this string to uppercase.
trim
Returns a string with leading and trailing whitespace removed.
replace
Returns a string with all occurrences of a character or sequence replaced.
replaceAll
Replaces each substring that matches the regex with the given replacement.
startsWith
Tests if this string starts with the specified prefix.
endsWith
Tests if this string ends with the specified suffix.
Returns true if this string contains the specified sequence of char values.
equals
Compares this string to the specified object for equality.
equalsIgnoreCase
Compares this string to another string, ignoring case considerations.
filter
Returns a stream consisting of elements that match the given predicate.
map
Returns a stream consisting of the results of applying the given function to the elements.
flatMap
Returns a stream consisting of the results of replacing each element with the contents of a mapped stream.
reduce
Performs a reduction on the elements using an associative accumulation function.
collect
Performs a mutable reduction operation on the elements using a Collector.
sorted
Returns a stream with elements sorted according to natural order or the provided comparator.
distinct
Returns a stream consisting of the distinct elements according to equals().
findFirst
Returns an Optional describing the first element of this stream, or empty if stream is empty.
anyMatch
Returns whether any elements of this stream match the provided predicate.
allMatch
Returns whether all elements of this stream match the provided predicate.
put
Associates the specified value with the specified key in this map.
Returns the value to which the specified key is mapped, or null if not present.
getOrDefault
Returns the value mapped to key, or defaultValue if key is not present.
containsKey
Returns true if this map contains a mapping for the specified key.
keySet
Returns a Set view of the keys contained in this map.
values
Returns a Collection view of the values contained in this map.
entrySet
Returns a Set view of the mappings contained in this map.
putIfAbsent
If the key is not already associated with a value, associates it with the given value.
Arrays.sort
Sorts the specified array into ascending order.
Arrays.binarySearch
Searches the specified sorted array for the specified value using binary search.
Arrays.asList
Returns a fixed-size list backed by the specified array.
Arrays.fill
Assigns the specified value to each element of the specified array.
Arrays.copyOf
Copies the specified array, truncating or padding with zeros/nulls if necessary.
Optional.of
Returns an Optional with the specified non-null value.
Optional.ofNullable
Returns an Optional describing the value if non-null, otherwise returns empty Optional.
orElse
Returns the value if present, otherwise returns the specified default value.
orElseGet
Returns the value if present, otherwise invokes the supplier and returns its result.
ifPresent
If a value is present, performs the given action with the value.