The moose likes Java in General and the fly likes Java Vectors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Vectors" Watch "Java Vectors" New topic

Java Vectors

Harsha vaka

Joined: Oct 03, 2007
Posts: 4
I have two vectors v1,v2 which contains strings in them, I want to compare
contents of v1 at index i with the contents of vector v2 at index j. If i use v1.get(i).equals(v2.get(j)); always returning false, even it contains common terms in both vectors.
please sugest solution for my problem.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

This isn't the appropriate forum for this kind of question. I will move this to the Java in General (Intermediate) forum.

GenRocket - Experts at Building Test Data
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282

prints: Same sequence of characters, valid. Can you show us your code ?
Makwana Deepak

Joined: Aug 14, 2007
Posts: 6
Nicholas Hi,

Yes you are right even I tried the same type of code with the Objects even there also it worked.

So the moral of the story is Harsha need to check his code properly, right.

Harsha, if you are using string content in vector object then "deepak" is different than "Deepak" so this might be the possiblility of your code too.

Makwana Deepak.
I agree. Here's the link:
subject: Java Vectors
jQuery in Action, 3rd edition