I have a question about boolean values in Java. Let\'s say I have a program like this:
boolean test = false;
...
foo(test)
foo2(test)
foo(Boolean test){
t
Your foo method changed the value of test to true. It looks like what you want is to use instance variables for each function.
boolean test = false;
...
foo(test)
foo2(test)
foo(Boolean test){
this.test = true;
}
foo2(Boolean test){
if(this.test)
//Doesn't go in here
}
This way, your method only changes the value of test inside of that method, but your public test parameter stays with a false value.