java—使用';属于';定义方法时的关键字

java—使用';属于';定义方法时的关键字,java,keyword,reactor,Java,Keyword,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(

在反应堆代码中,我可以看到

/**
 * 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);
}
/**
*使用给定对象创建一个{@link Tuple1}。
*
*@param t1是元组中的第一个值。
*@param第一个值的类型。
*@返回新的{@link Tuple1}。
*/
公共静态Tuple1 of(T1){
返回新的Tuple1(t1);
}

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

您看到的不是一个新的
of
关键字。它实际上是该方法的名称,尽管它看起来可能不太像

这就是这个方法的名称。@SotiriosDelimanolis我喜欢答案像这样递归:()()()()()()()()()!你是对的!我只是忽略了,想知道这是什么“的”。谢天谢地的命名convention@user2310289嗯,我认为它被使用了一些(尽管我承认,这两者并不一定相互排斥)。