string equality in java

Java
String str = "abc";
String str1 = "abc";
System.out.println(str.equals(str1));
// returns true if str and str1 are exactly same otherwise false
Source

Also in Java: