principal-ideal-domain
principal-ideal-domain

Reputation: 4268

Which is the Charset java uses to store strings internally?

Using the method String.getBytes(Charset cs) we can turn a string into a byte array with respect to a certain encoding. But before doing that the string is already stored at some point in our random access memory. Which charset is used here?

Upvotes: 1

Views: 54

Answers (1)

SLaks
SLaks

Reputation: 887469

Java strings using an array of chars, which are UTF-16.

Upvotes: 3

Related Questions