Sharing Thread Data

I'm going through the java socket tutorial (http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html) and implementing the multi-client server at the bottom of the page.

However, I'm trying to add a method to the main class that creates the threads, increment(), that can be called by any of the threads to increment a simple counter in the base class. How can I set this up so that any of the threads can call this method, which is a parent two classes above the thread classes?

[514 byte] By [yoblina] at [2007-11-27 7:41:47]
# 1
public synchronized static void increment()?
bsampieria at 2007-7-12 19:22:29 > top of Java-index,Java Essentials,New To Java...