Thread: Quiz Time
View Single Post
  #36 (permalink)  
Old 05-08-2008, 12:26 PM
rjuyal's Avatar
rjuyal rjuyal is offline
Senior Member
 
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
rjuyal is on a distinguished road
thanks
Code:
public class EqualsCheck { public static void main(String[] args) { String s = "Hello"; String s1 = "Hello"; String s2 = new String("Hello"); if(s == s1) System.out.println("Yes, =="); else System.out.println("No, =="); if(s == s2) System.out.println("Yes, =="); else System.out.println("No, =="); /******************************/ if(s.equals(s1)) System.out.println("Yes, equals()"); else System.out.println("No, equals()"); if(s.equals(s2)) System.out.println("Yes, equals()"); else System.out.println("No, equals()"); /******************************/ } }


Wow... i wanted this actually

Thanks Sanjeev
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
Reply With Quote