Search:

Type: Posts; User: Norm

Search: Search took 0.16 seconds.

  1. Replies
    13
    Views
    2,551

    [SOLVED] Re: "If" statement not working

    Remove all the static variables from your code except the one on the main method.
  2. Replies
    13
    Views
    2,551

    [SOLVED] Re: "If" statement not working

    You should NOT use statics to get around passing references to objects.
  3. Replies
    13
    Views
    2,551

    [SOLVED] Re: "If" statement not working

    Please explain what the problem is? What is supposed to change and what is to make it change?
  4. Replies
    13
    Views
    2,551

    [SOLVED] Re: "If" statement not working

    The '== true' is redundant. The equals method returns a boolean.
    if(temp.equals("Red")) {
  5. Replies
    13
    Views
    2,551

    [SOLVED] Re: "If" statement not working

    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.
  6. Replies
    13
    Views
    2,551

    [SOLVED] Re: "If" statement not working

    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.
Results 1 to 6 of 6