title: Android compare string with two method but still not work
body: <p>Can you help me, why my code not work?</p>
  
  <p>Output :</p>
  
  <p>03-17 16:54:25.488: D/wew(3821): msg :test</p>
  
  <p>03-17 16:54:25.488: I/System.out(3821): #1: false</p>
  
  <p>03-17 16:54:25.488: I/System.out(3821): #2: false</p>
  
  <p>And this is my code :</p>
  
  <pre><code>        charsRead = in.read(buffer);
                          if (charsRead != 1) {
                              String message = new String(buffer).substring(
                                      0, charsRead).toString();
                              Log.d("wew", "msg :" + message);
  
                              String w1 = "test";
                              String w2 = message;
  
                              if(w1 == w2){
                                  System.out.println("#1: true");
                                  } else {
                                  System.out.println("#1: false");
                                  }
  
                                  if(w1.equals(w2)){
                                  System.out.println("#2: true");
                                  } else {
                                  System.out.println("#2: false");
                                  }
  
                          }
  </code></pre>