Jump to content

Number Game of Death


Th3

Recommended Posts

If you dare to play save all your work first.

 

Run the following and report back the last number you see. Highest number wins. Mine was 50585.

public class NumberGameOfDeath {
    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();
        }
    }
}

If you don't know how to run it. Then go learn it bitch.

 

Take a picture of it if you can.

Edited by Th3
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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