Skip to main content
The 2024 Developer Survey results are live! See the results
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
  • 403.2k
  • 210
  • 570
  • 887

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.
  • 32.7k
  • 14
  • 84
  • 96

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
  • 56.2k
  • 14
  • 99
  • 153

How do I compare stringstrings in Java?

edited title
Link
mmcdole
  • 92.4k
  • 61
  • 186
  • 223
Loading
fixed formatting
Source Link
Torsten Marek
  • 85.6k
  • 21
  • 92
  • 98
Loading
Source Link
Nathan H
  • 48.9k
  • 60
  • 168
  • 249
Loading