【发布时间】:2018-07-04 10:27:24
【问题描述】:
当你认为你已经看到了这一切时,下面的代码会在我希望学习的 java .class 中弹出。
我不完全确定这里发生了什么。首先声明了clean();,但它看起来既像一个字段又像一个方法?
然后它下面的另一种方法使用这个clean();,尽管在声明后backets中没有任何代码?
我很困惑。谁能解释一下这个语法?
public abstract void clean();
/**
* Clean method called whenever the user interface is closed, in order to clean
* internal and user-defined structures properly.
*/
void cleanFromUI()
{
// clean user-specific items
try
{
clean();
}
catch (EzException eze)
{
// do not display anything as the interface is being closed
if (!eze.catchException) throw eze;
}
// clear all variables
ezVars.clear();
ezgui = null;
synchronized (nbInstances)
{
nbInstances.setValue(nbInstances.getValue() - 1);
}
}
【问题讨论】:
标签: java methods syntax format