public class Comparison { public static void main(String[] args) { String s = \"prova\"; String s2 = \"prova\"; System.
You must understand that "==" compares references and "equals" compares values. Both s and s1 are pointing to the same string literal, so their references are the same.
s
s1