public class stringtest {
    public static void main(String[] args) {

	String x = "test1";
	String y = "test2";
	String z = "test1";

	String[] s1 = new String[3];
	s1[0] = y;
	s1[1] = z;
	s1[2] = "stuff";

	for (int i=0; i<s1.length; i++)
	    System.out.println("Result of "+(i+1)+"th case: "+x.equals(s1[i]));

	// So, can you use $==$? Well, please refer to 
	// http://courses.cs.cornell.edu/cs100/2000sp/Examples/string2.txt
	// for a full explanation and demo.

    }

}

/* output:

try to predict....

 */
