有一个类addRecursively()
,该类具有方法childFunc()
,该方法具有子功能(这是正确的词btw吗?)addRecursively()
,它依次调用class Test {
addRecursively = function (i) {
i++;
childFunc();
function childFunc(){
if (i==5) {
console.log(i);
} else {
console.log("Not yet");
this.addRecursively(i); // Cannot read property 'addRecursively' of undefined
}
}
}
}
var testObj = new Test();
testObj.addRecursively(0);
testObj
如何在不明确解决private void tableKeyPressed(java.awt.event.KeyEvent evt) {
int keycode = evt.getKeyCode();
if (keycode == KeyEvent.VK_ENTER) {
pricetext.setText(Integer.toString(calculatesum()));
}
}
示例的情况下调用父函数?