java - 定义方法时使用“of”关键字

roh*_*hta 0 java keyword reactor

在 Reactor 代码中我可以看到类似的内容

/**
 * 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);
}
Run Code Online (Sandbox Code Playgroud)

这个“of”关键字是什么?

tbo*_*odt 5

您看到的不是新of关键字。它实际上是方法的名称,尽管看起来可能不是这样。