Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test;
- import java.util.ArrayList;
- public class ThreadTest
- {
- public void startCPUHungryThread()
- {
- Runnable runnable = new Runnable(){
- public void run()
- {
- while(true)
- {
- }
- }
- };
- Thread thread = new Thread(runnable);
- thread.start();
- }
- public static void main(String[] args)
- {
- ThreadTest thread = new ThreadTest();
- for (int i=0; i<2; i++)
- {
- thread.startCPUHungryThread();
- }
- }
- }
Add Comment
Please, Sign In to add comment