Question Protected by CommunityBot
Question Unprotected by animuson
Post Locked by animuson
Notice added Wiki Answer by animuson
Post Made Community Wiki by Sanjay
deleted 10 characters in body
Source Link
Bill the Lizard
  • 383.9k
  • 205
  • 554
  • 860

I've been using the "==" operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.

Is "==" bad? When should it and should it not be used? What's the difference?

I've been using the "==" operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.

Is "==" bad? When should it and should it not be used? What's the difference?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.

Is == bad? When should it and should it not be used? What's the difference?

deleted 12 characters in body
Source Link
Peter O.
  • 30.5k
  • 14
  • 76
  • 90

I've been using the "==" operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.

Is "==" bad? When When should it and should it not be used? What's What's the difference?

Thanks

I've been using the "==" operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.

Is "==" bad? When should it and should it not be used? What's the difference?

Thanks

I've been using the "==" operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.

Is "==" bad? When should it and should it not be used? What's the difference?

Question Protected by Mat
edited tags; edited title
Link
starblue
  • 53.1k
  • 14
  • 93
  • 147

How do I compare stringstrings in Java?

edited title
Link
mmcdole
  • 88.4k
  • 60
  • 182
  • 221
Loading
fixed formatting
Source Link
Torsten Marek
  • 78.4k
  • 20
  • 89
  • 98
Loading
Source Link
Nathan H
  • 46k
  • 56
  • 160
  • 241
Loading