C
Christoph
One of my classes contains static variables that are set by the
program.
If the program is executed several times (distinct execute commands,
but the same VM and the same code base), will the two program threads
share the same static variables?
Rough example:
public class Main
{
static BufferedReader input;
static PrintStream output;
public static void main(String[] args)
{
input = new BufferedReader(new FileReader(args[0]));
...
}
}
Will this cause conflicts if the program is run on different input
files simultaneously? If so, I'd put these streams in an additional
wrapper object, but I'd rather avoid that if it's not necessary.
program.
If the program is executed several times (distinct execute commands,
but the same VM and the same code base), will the two program threads
share the same static variables?
Rough example:
public class Main
{
static BufferedReader input;
static PrintStream output;
public static void main(String[] args)
{
input = new BufferedReader(new FileReader(args[0]));
...
}
}
Will this cause conflicts if the program is run on different input
files simultaneously? If so, I'd put these streams in an additional
wrapper object, but I'd rather avoid that if it's not necessary.