垃圾回收实例
来源:互联网 发布:网络方面 证书 编辑:程序博客网 时间:2024/06/05 08:08
package 垃圾回收;
import java.applet.*;
import java.awt.*;
class thing
{
public static int thingcount = 0;
public static int thingfinal = 0;
public thing()
{
++thingcount;
}
protected void finalize()
{
++thingfinal;
}
}
public class Test extends Applet
{
public Test()
{
}
public String getAppletInfo()
{
return "Name: final_thing/r/n" +
"Author: Tim Gooch/r/n" +
"Created with Microsoft " +
"Visual J++ Version 1.1";
}
public void init()
{
resize(320, 240);
}
public void destroy()
{
}
public void paint(Graphics g)
{
g.drawString("Created with Microsoft" +
"Visual J++ Version 1.1", 10, 20);
}
public void start()
{
while(thing.thingfinal < 1)
{
new thing();
}
}
public void stop()
{
// System.gc();
System.out.println(thing.thingcount +
" things constructed");
System.out.println(thing.thingfinal +
" things finalized");
}
}
0 0
- 垃圾回收实例
- java垃圾回收测试实例
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- 垃圾回收
- spring-boot thymeleaf对没有结束符的HTML5标签解析出错解决办法
- SylixOS CAN总线驱动之三
- 关于在jsp中,<a>标签在confirm为false之后,还能继续跳转的问题.
- html5视频播放器 二 (功能实现及播放优化)
- 保存文件
- 垃圾回收实例
- error LNK2019: 无法解析的外部符号 _SQLConnect@28,该符号在函数
- 动态规划:最大子矩阵
- 将二叉树拆成链表
- POJ-3013: Big Christmas Tree(dij,spfa)
- dede中php标签用法
- vb.net 教程 5-13 图像处理之像素处理 6
- 动态规划总结
- 有关线程的相关知识(上)