public class SubString1
{
public static void main(String[] args)
{
String s="Sachin";
String sb=s+"Tendulkar";
String sbc="SachinTendulkar";
System.out.println(sb==sbc);
}
}
Output : false.
Please Explain how the output is false??
I couldn't understand the logic behind this type of object creation. According to me both should refer to same instance and Answer should have been true. Please Explain.