关于DefaultPersistenceDelegate,我在Java源代码方面遇到了一些问题

关于DefaultPersistenceDelegate,我在Java源代码方面遇到了一些问题,java,Java,我刚刚在DefaultPersistenceDelegate的java源代码方面遇到了一些问题,下面是代码: /** * This default implementation of the <code>instantiate</code> method returns * an expression containing the predefined method name "new" which denotes a * call to a constru

我刚刚在DefaultPersistenceDelegate的java源代码方面遇到了一些问题,下面是代码:

    /**
 * This default implementation of the <code>instantiate</code> method returns
 * an expression containing the predefined method name "new" which denotes a
 * call to a constructor with the arguments as specified in
 * the <code>DefaultPersistenceDelegate</code>'s constructor.
 *
 * @param  oldInstance The instance to be instantiated.
 * @param  out The code output stream.
 * @return An expression whose value is <code>oldInstance</code>.
 *
 * @throws NullPointerException if {@code out} is {@code null}
 *                              and this value is used in the method
 *
 * @see #DefaultPersistenceDelegate(String[])
 */
protected Expression instantiate(Object oldInstance, Encoder out) {
    int nArgs = constructor.length;
    Class<?> type = oldInstance.getClass();
    Object[] constructorArgs = new Object[nArgs];
    for(int i = 0; i < nArgs; i++) {
        try {
            Method method = findMethod(type, this.constructor[i]);
            constructorArgs[i] = MethodUtil.invoke(method, oldInstance, new Object[0]);
        }
        catch (Exception e) {
            out.getExceptionListener().exceptionThrown(e);
        }
    }
    return new Expression(oldInstance, oldInstance.getClass(), "new", constructorArgs);
}
在return语句中,它返回一个方法名为“new”的表达式,但在我的记忆中,“new”应该是一个构造名,没有一个方法名为“new”


这个问题让我困惑了好几天,有人能帮我吗?

对不起,“new”应该是一个构造名而不是方法名”这句话在英语中是不可解析的。语法看起来完全有效,不清楚您不理解什么<代码>新表达式(…)实例化对象并调用构造函数。不…我尝试获取以下示例代码:Integer=1;新表达式=新表达式(整数,“新”,新对象[]{10});重新执行();System.out.println(aNew.getValue());当我尝试调用异常并得到一个java.lang.NoSuchMethodException时,它会抛出一个异常