Jump to content

why i love programming


Recommended Posts

Posted
public class ScripterApplication {
    private static Object s = new Object();
    private static int count = 0;
 
    public static void main(String[] argv) {
        for (; ; ) {
            new Thread(new Runnable() {
                public void run() {
                    synchronized (s) {
                        count += 1;
                        System.err.println("New thread #" + count);
                    }
                    for (; ; ) {
                        try {
                            Thread.sleep(1000);
                        } catch (Exception e) {
                            System.err.println(e);
                        }
                    }
                }
            }).start();
        }
    }
}

Ask @Alek that's how I got scripter two

Posted
23 minutes ago, Saiyan said:

public class ScripterApplication {
    private static Object s = new Object();
    private static int count = 0;
 
    public static void main(String[] argv) {
        for (; ; ) {
            new Thread(new Runnable() {
                public void run() {
                    synchronized (s) {
                        count += 1;
                        System.err.println("New thread #" + count);
                    }
                    for (; ; ) {
                        try {
                            Thread.sleep(1000);
                        } catch (Exception e) {
                            System.err.println(e);
                        }
                    }
                }
            }).start();
        }
    }
}

Ask @Alek that's how I got scripter two

lol

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...