LINUKS BLOG

Make progress is the topic for ever...

My Photo
Name:
Location: China

It's a fans of computer/ Computer is my favorite/ Making progress is the topic for ever...

Friday, November 02, 2007

Java 中的多线程

import java.awt.*;
public class MainFrame extends Frame implements Runnable
{
public MainFrame(String title)
{
super(title);
……
new Thread(this).start();
……
}
……
public void run()
{
try
{
while(true)
{
this.sleep(1000);
//这里写调用的方法名

}
}
}
}

Thursday, November 01, 2007

Java String

String s;//创建一个引用变量
String s="abc";//创建一个字符对象"abc"和一个引用变量s
String s=new String("abc");//创建两个字符对象,和两个引用变量

equal

String s=new String(); s="abc";//先创建一个空间对象,而后又用引用指向"abc"这个字符对象.


java 术语:constant pool 字符串池