/**
 * Created by IntelliJ IDEA.
 * User: gloyaute
 * Date: 10 11 2011
 * Time: 19:47:59
 * To change this template use File | Settings | File Templates.
 */

public class NonMutableString {

    public static void main(String[] args) {
        String s1="toto";
        String s2 = s1;
        String s3 = new String(s1);

        // Question 1: Comparaison de reference!
        System.out.println(s1 == s2);
        System.out.println(s1 == s3);

        // Question 2: Methode equals

        s1 = "toto";
        s2 = "toto";
        System.out.println(s1 == s2);

        String s = "hello";
        s.toUpperCase();
        System.out.println(s);

    }
}
