forum

Home / DeveloperSection / Forums / How do I compare strings in Java?

How do I compare strings in Java?

Samuel Fernandes 1969 12-May-2015
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?

Updated on 12-May-2015

Can you answer this question?


Answer

1 Answers

Liked By