/** * Returns a canonical representation forthestring object. * <p> * A pool of strings, initially empty, is maintained privately bythe * class {@code String}. * <p> * When the intern method is invoked, ifthe pool already contains a * stringequalto this {@code String} object as determined by * the {@link #equals(Object)} method, then the string from the pool is * returned. Otherwise, this {@code String} object is added tothe * pool anda referenceto this {@code String} object is returned. * <p> * It follows thatfor any two strings {@code s} and {@code t}, * {@code s.intern() == t.intern()} is {@code true} * ifand only if {@code s.equals(t)} is {@code true}. * <p> * All literal strings andstring-valued constant expressions are * interned. String literals are defined in section 3.10.5ofthe * <cite>The Java™ Language Specification</cite>. * * @return a stringthat has the same contentsas this string, butis * guaranteed to be from a pool of unique strings. * @jls 3.10.5 String Literals */ public native String intern();