Welcome back, friends. Most of the Java developers knows What is different between “equals” and “==” operator and how it different while comparing two string using “equals” and “==”.
String name1 = “Suresh”;
String name2 = new String(“Suresh”);
System.out.println(name1 == name2); // false
System.out.println(name1.equals(name2)); // true

In the above program…

Suresh

I am a Java / J2EE Consultant. Happy to learn. https://pinepad.in/blog/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store