当前下载的版本
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
jdk与Eclipse环境搭建
随后安装eclipse
jdk与Eclipse环境搭建
jdk与Eclipse环境搭建
附一个简单的多线程例子

public class Hello_Java {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println("Hello Java and Hello World");
		UserThread t1,t2,t3,t4;
		t1=new UserThread("1");
		t2=new UserThread("2");
		t3=new UserThread("3");
		t4=new UserThread("4");

		t1.start();
		t2.start();
		t3.start();
		t4.start();
	}

}

class UserThread extends Thread{
	int sleeptime;
	public UserThread(String id) {
		super(id);
		sleeptime=(int)(Math.random()*1000);
		System.out.println("线程号: "+getName()+",睡眠"
				+sleeptime+"毫秒");
	}
	public void run(){
		try{
			Thread.sleep(sleeptime);
		}catch(InterruptedException e) {
			System.err.println("error"+e.toString());
		}
		
		System.out.println("运行的线程是:"+getName());
	}
}

jdk与Eclipse环境搭建
路漫漫其修远兮,吾将上下而求索!

相关文章:

  • 2021-08-19
  • 2021-11-29
  • 2021-04-19
  • 2021-07-27
  • 2021-08-02
  • 2021-12-27
  • 2021-12-05
猜你喜欢
  • 2021-06-21
  • 2021-08-14
  • 2021-04-21
  • 2021-11-29
  • 2021-11-04
  • 2021-05-10
  • 2021-03-31
相关资源
相似解决方案