This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Vectors" Watch "Java Vectors" New topic
Author

Java Vectors

Harsha vaka
Greenhorn

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: 15299
    
    6

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
Greenhorn

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.

Regards,
Makwana Deepak.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Vectors
 
Similar Threads
Parsing elements of a Vector
Shallow Copying And Deep copying ?
for loop logic problem
Help please
java Vectors