I'm working on a TCP socket right now. I derive my server class from Thread.
public class TCPServer extends Thread {
public static int SERVERPORT = 54321;
....
<code>
}
When I use this class, it will open several threads. My question is, does each thread have its own static variable SERVERPORT? Because it seems like if I edit this variable, it does not have effect in others.
My solution to this problem would be to create another class, say "GlobalVariables" and give this class access to it.