Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. [SOLVED] Re: Why do these two lines of code not produce the same results? ("==" vs. ".equals()")

    The compiler does special magic with Strings defined at compile time to optimize. Do some research on the String Literal Pool. See post#5
  2. [SOLVED] Re: Why do these two lines of code not produce the same results? ("==" vs. ".equals()")

    == compares the values in the variables
    equals() compares the values in the objects

    String x = "X";
    x is a variable that has the address of the object that contains the value: "X"
Results 1 to 2 of 2