代码:abstract class GetTime
{
public final void getTime()
{
long start = System.currentTimeWillis();
runcode();
long end = System.currrentTimeWillis();
System.out.println("毫秒;"+(end-start));
}
public abstract void runcode();
}
class SubTime extends GetTime
{
public void runcode()
{
for (int x=0;x<5000 ;x++ )
{
System.out.print(x);
}
}
}
class MyTime
{
public static void main(String[] args)
{
SubTime gt = new SubTime();
gt.getTime();
}
}
错误提示:MyTime.java:5: 错误: 找不到符号
long start = System.currentTimeWillis();
^
符号: 方法 currentTimeWillis()
位置: 类 System
MyTime.java:9: 错误: 找不到符号
long end = System.currrentTimeWillis();
^
符号: 方法 currrentTimeWillis()
位置: 类 System
2 个错误
求帮助 |