Question

In the Reactor code I could see something like

/**
 * Create a {@link Tuple1} with the given object.
 *
 * @param t1   The first value in the tuple.
 * @param <T1> The type of the first value.
 * @return The new {@link Tuple1}.
 */
public static <T1> Tuple1<T1> of(T1 t1) {
    return new Tuple1<T1>(t1);
}

What is this 'of' keyword?

Was it helpful?

Solution

What you are seeing is not a new of keyword. It is actually the name of the method, even though it may not seem like it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top