• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Vectors

 
Harsha vaka
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't the appropriate forum for this kind of question. I will move this to the Java in General (Intermediate) forum.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


prints: Same sequence of characters, valid. Can you show us your code ?
 
Makwana Deepak
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic