-
Equality of strings
Hi,
I have two strings that I think are the same. One is in an array list and the other is in an array.
Heres what they look like:
String[] names = new String[l];
ArrayList<String> v = new ArrayList<String>();
If I print them out like:
System.out.print(v.get(l+1) + " " + names[i]);
they both show dave
but if i do
if(names[i] == v.get(l+1))
the if statement returns false, (this is in a for statement)
Anyone know why this could be happening?
Thanks.
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|