You are on page 1of 1

public class Demo1

{
public static void main(String args[])
{
//String str1="hello";
String str1=new String("hello");
if(str1==str1.intern())
{
System.out.println("str1 and its intern are same");
}
else
{
System.out.println("str1 and its intern are not same");
}
}
}

You might also like