Why should we prefer using .equals() to == while comparing strings in Java?
Jan 25, 2022 · 4 min read · Understanding the difference In Java, we know that for checking if the two values are equal or not, we use ==. For example, if we execute the following code, public static void main(String args[]) { int a=5; int b=5; int c=7; ...
STZSayantani and 2 more commented
