Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Mojwatek implements Runnable {
- @Override
- public void run() {
- try {
- Thread.sleep(10000);
- } catch (InterruptedException ex) {
- System.out.println(ex.toString());
- }
- catch (Exception e)
- {
- System.out.println(e.toString());
- }
- }
- }
- ---------------------------------------------
- public class Main {
- public static void main(String[] args) {
- Mojwatek w1 = new Mojwatek();
- int x=0;
- while (true)
- {
- Thread temp = new Thread(w1);
- temp.start();
- x++;
- System.out.println(x);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement