In Java, all but primitive types are references. String not considered a primitive type, but char is. So AFAIK 'a' in your example is not a link.
However, Java does support autoboxing , so if you try to use "a" as an object, it will probably work just as if it were a link.
Update : some examples may help here:
char a = 'a'; char b = 'a'; System.out.println(a == b); // true String c = "a"; String d = "a"; System.out.println(c == d); // Dunno; may be true if the compiler created a single object for c and d, otherwise it false String e = new String("a"); String f = new String("a"); System.out.println(e == f); // false
source share