how to know if String is the same java

Java
String1.equals(String2)
Source

Also in Java: