public class StringTest2 {
public
static void main (String args[] ) {
System.out.println("Case
1");
String st1 = new String();
String st2 = new String();
if (st1 == st2)
System.out.println("st1 is == st2");
else
System.out.println("st1 is NOT == st2");
System.out.println("Case
2");
st1 = new String("Hello");
st2 = new String("Hello");
if (st1 == st2)
System.out.println("st1 is == st2");
else
System.out.println("st1
is NOT == st2");
System.out.println("Case
3");
st2 = "Bye";
if (st1 == st2)
System.out.println("st1 is == st2");
else
System.out.println("st1 is NOT == st2");
System.out.println("Case
4");
st2 = st1;
if (st1 == st2)
System.out.println("st1 is == st2");
else
System.out.println("st1 is NOT == st2");
System.out.println("Case
5");
st1 = "Hello";
st2 = "Hello";
if (st1 == st2)
System.out.println("st1 is == st2");
else
System.out.println("st1 is NOT == st2");
System.out.println("Case
6");
String st3 = "Hello";
if (st1 == st3)
System.out.println("st1 is == st3");
else
System.out.println("st1 is NOT == st3");
} //main
} //class