1. an interface represents a kind of behavior and consists of a set of method declarations2. Java documentation:
public String toString()
Returns a string representation of this thread, including the thread's name, priority, and thread group.
public String toString()
Returns a string representation of this thread, including the thread's name, priority, and thread group.
解决方案 »
- 关于在txt文本中的字符串的替换问题
- 今天下午我郁闷的很
- java有没有计算方差和标准差的函数?
- 新手问题
- 开发java将近两年,一家单位血癌女冠让过去高php,请问值得吗?
- aa
- java中都有哪些方法遍历set集合
- 求源程序:计算数字表达式的值
- 望高人指点一二,感激不尽!
- 我在CLASS中用NEW SOCKET()不会出问题,但是到APPLICATION中则会提示java.security.AccessControlException: access denied (java.net.
- 有谁知道全景演示制作的原理吗, 能给几个小sample最好
- Web方式的Java Application如何去掉下面的Applet窗口?
是否
Thread.currentThread();
的一定是main
{
twothread()
{
Thread t1=Thread.currentThread();
t1.setName("The first main thread");
System.out.println("The running thread:"+t1); //*********************************
ThreadGroup tg = new ThreadGroup("another thread group");
Thread t2=new Thread(tg, this,"these cond thread");
System.out.println("creat another thread");
t2.start();
try
{
System.out.println("first thread will sleep");
Thread.sleep(3000);
}
catch(InterruptedException e)
{
System.out.println("first thread has wrong");
}
System.out.println("first thread exit");
}
public void run()
{
try
{
for(int i=0;i<5;i++)
{
System.out.println("Sleep time for thread2:"+i);
System.out.println("The running thread:"+Thread.currentThread());
Thread.sleep(1000);
}
}
catch(InterruptedException e)
{
System.out.println("thread has wrong");
}
System.out.println("second thread exit");
}
public static void main(String args[])
{
new twothread();
}
}output:
The running thread:Thread[The first main thread,5,main]
creat another thread
first thread will sleep
Sleep time for thread2:0
The running thread:Thread[these cond thread,5,another thread group]
Sleep time for thread2:1
The running thread:Thread[these cond thread,5,another thread group]
Sleep time for thread2:2
The running thread:Thread[these cond thread,5,another thread group]
first thread exit
Sleep time for thread2:3
The running thread:Thread[these cond thread,5,another thread group]
Sleep time for thread2:4
The running thread:Thread[these cond thread,5,another thread group]
second thread exit
public Object transform(Object input)
Transforms the input object (leaving it unchanged) into some output object.
Returns:
the transformation of the input object to the output object
又恨又爱……
target 是代表什么?