for (int i = 0; i < dest.length; i++) {
System.out.println(dest[i]);
}
}
public static void demo3() {
long start = System.currentTimeMillis(); //1秒等于1000毫秒
for(int i = 0; i < 1000; i++) {
System.out.println("*");
}
long end = System.currentTimeMillis(); //获取当前时间的毫秒值
System.out.println(end - start);
}
public static void demo2() {
System.exit(1); //非0状态是异常终止,退出jvm
System.out.println("11111111111");
}
public static void demo1() {
for(int i = 0; i < 100; i++) {
new Demo();
System.gc(); //运行垃圾回收器,相当于呼喊保洁阿姨
}
}
}
class Demo { //在一个源文件中不允许定义两个用public修饰的类
@Override
public void finalize() {
System.out.println("垃圾被清扫了");
}