class NewThread extends Thread{
boolean suspendFlag;
NewThread(String threadname
super(tgOb
System
suspendFlag = false;
start();
}
public void run(){
try{
for(int i=
System
Thread
synchronized(this){
while(suspendFlag){
wait();
}
}
}
}catch(Exception e){
System
}
System
}
void mysuspend(){
suspendFlag = true;
}
synchronized void myresume(){
suspendFlag = false;
notify();
}
}
public class test {
public static void main(String[] args) {
// TODO Auto
ThreadGroup groupA = new ThreadGroup(
ThreadGroup groupB = new ThreadGroup(
NewThread ob
NewThread ob
NewThread ob
NewThread ob
System
Thread tga[] = new Thread[groupA
groupA
for(int i=
((NewThread)tga[i])
}
try {
Thread
}catch(InterruptedException e){
System
}
System
for(int i=
((NewThread)tga[i])
}
try {
System
ob
ob
ob
ob
}catch (Exception e){
System
}
System
}
}
From:http://tw.wingwit.com/Article/program/Java/gj/201311/27490.html