Remove all the static variables from your code except the one on the main method.
Type: Posts; User: Norm
Remove all the static variables from your code except the one on the main method.
You should NOT use statics to get around passing references to objects.
Please explain what the problem is? What is supposed to change and what is to make it change?
The '== true' is redundant. The equals method returns a boolean.
if(temp.equals("Red")) {
You need to use the equals() method when comparing the contents of String objects. The == operator tests if the two variables refer to the same object.
Are you using the equals method to compare the contents of two Strings?
If would be better if you posted the code here so we could see the statement that is the problem.