Thread: Quiz Time
View Single Post
  #49 (permalink)  
Old 05-08-2008, 01:02 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
EQUALS CODE of STRING CLASS

Code:
if (this == anObject) { return true; } if (anObject instanceof String) { String anotherString = (String)anObject; int n = count; if (n == anotherString.count) { char v1[] = value; char v2[] = anotherString.value; int i = offset; int j = anotherString.offset; while (n-- != 0) { if (v1[i++] != v2[j++]) return false; } return true; } } return false;

anyways... next question please
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
Reply With Quote