java中线程的创建
package com.carlinfo.bigdata;
/**
* java中线程的创建
*/
public class Ops3
{
public static void main(String[] args)
{
/**
* 线程一
*/
Thread t1 = new Thread(new Runnable()
{
@Override
public void run()
{
System.out.println("t1-----");
}
});
/**
* 线程二
*/
Thread t2 = new Thread(new Runnable()
{
@Override
public void run()
{
System.out.println("t2-----");
}
});
/**
* 线程开始
*/
t1.start();
t2.start();
}
}