Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The in-memory representation used in the <code>String</code> type's char array is UTF-16. Modified UTF-8 is used in other contexts; e.g. in ".class" files, and the object serialization format.</p> <p>You can confirm this by looking at the source code of the <code>java.lang.String</code> class.</p> <p><strong>UPDATE</strong></p> <p>With Java 6 update 21 and later, there is a non-standard option to enable compressed strings.</p> <p>With Java 9 and later, the behavior has been changed to use the compact representation for Strings by default. The <code>java</code> command <a href="https://docs.oracle.com/javase/9/tools/java.htm" rel="nofollow noreferrer">documentation</a> now says this:</p> <blockquote> <p>-XX:-CompactStrings</p> <p>Disables the Compact Strings feature. By default, this option is enabled. When this option is enabled, Java Strings containing only single-byte characters are internally represented and stored as single-byte-per-character Strings using ISO-8859-1 / Latin-1 encoding. This reduces, by 50%, the amount of space required for Strings containing only single-byte characters. For Java Strings containing at least one multibyte character: these are represented and stored as 2 bytes per character using UTF-16 encoding. Disabling the Compact Strings feature forces the use of UTF-16 encoding as the internal representation for all Java Strings.</p> </blockquote> <p>(Note that is not UTF-8 encoding.)</p> <p>See also:</p> <ul> <li><a href="https://docs.oracle.com/javase/9/whatsnew/toc.htm" rel="nofollow noreferrer">Java Platform, Standard Edition What’s New in Oracle JDK 9</a></li> <li><a href="http://openjdk.java.net/jeps/254" rel="nofollow noreferrer">JEP 254: Compact Strings</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload