🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #18821

���

#18821
From: �Ұ���
Date: Sat, 31 Jan 2004 01:52
45 lines
2133 bytes
����һ��С���򣬹��������߳�һ������
import java.io.*;
import java.net.*;
public class Threadtest {
  public static void main (String[] args) {
    try {
      CountTen no1=new CountTen("No1");
      CountTen no2=new CountTen("No2");
      Thread no1_thread=new Thread(no1);
      Thread no2_thread=new Thread(no2);
      no1_thread.start() ;
      no2_thread.start() ;
    }
    catch (Exception e) {
      System.err.println("wrong") ;
      System.exit(1) ;
    }
  }

  class CountTen implements Runnable {
    String myname;
    public CountTen (String name) {
      myname=name;
    }
    public void run () {
      int i;
      for (i=0;i<=10;i++) {
        System.out.println(myname+":"+i);
      }
    }
  }
}
����  CountTen no1=new CountTen("No1");
      CountTen no2=new CountTen("No2");
������non-static variable this cannot be referenced from
      a static context
�����ʲô���󰡣�лл��

--
��26��Ӣ����ĸ���θ��֣�A=1,B=2����Y=25,Z=26
ѧʶ��KNOWLEDGE=11+14+15+24+12+5+4+7+4=96���ܸ���96��
�ڷܣ�HARDWORK=8+1+18+4+23+15+18+11=98���ܸ���98��
ֻ��̬�ȣ�ATTITUDE=1+20+20+9+20+21+4+5=100)������õ������100�֡�  

�� ��Դ:��Ʈ��ˮ�Ƽ� freecity.cnzju.net��[FROM: yjchen]
Technical Details
Message-ID: <4AT2eT$ACV@freecity.cnzju.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!feed2.newsreader.com!newsreader.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!Freecity

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB
X-Google-Thread: f6cb0,90728799bf82141f,start
X-Google-Attributes: gidf6cb0,public
X-Google-ArrivalTime: 2004-01-30 17:50:34 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!feed2.newsreader.com!newsreader.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!Freecity
From: yjchen.bbs@freecity.cnzju.net (�Ұ���)
Newsgroups: cn.bbs.comp.lang.java
Subject: ���
Date: 31 Jan 2004 01:52:55 GMT
Organization: Ʈ��ˮ�Ƽ�
Message-ID: <4AT2eT$ACV@freecity.cnzju.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: Java/M.1075513757.A