KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > StringEqualsTest


1 public class StringEqualsTest {
2
3     public static void main(String JavaDoc [] args){
4         String JavaDoc l1 = "the" + "re";
5         String JavaDoc l2 = "ther" + "e";
6
7
8         if (l1 == l2) {
9             System.out.println("== works");
10         }
11
12         if (l1.equals(l2)){
13             System.out.println(".equals works");
14         }
15         
16     }
17 }
18
Popular Tags