public class Comparison { public static void main(String[] args) { String s = \"prova\"; String s2 = \"prova\"; System.
String s = "prova"; String s2 = "prova";
s and s2 are literal strings which are pointing the same object in String Pool of JVM, so that the comparison returns true.
s
s2