answersLogoWhite

0

To be able to represent more characters. With 1-byte (8-bit) characters, you can only use 256 different characters. In order to be able to use more characters, the Unicode system - used by Java and many other modern programming language - uses larger characters. In Unicode, over a million characters can be defined; this makes it possible to encode not just Latin characters (the characters used in English) and the same Latin characters with lots of diacriticals (special symbols, for example, á, é, ñ, ü, etc.), but also characters in other languages, such as Russian, Chinese, or even Klingon.


In the case of Java, the standard size of a character is 16 bits (or 2 bytes). In theory, this makes it possible to represent only about 65,000 different characters, but by using some 2-character pairs (4 bytes in total), the entire Unicode set can be represented.


User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is the ' ' called in java?

' ' would be the character for a space in Java.


Can a character in java apply in JOptionPane?

no!!


What is the Size of a java class?

Java classes can have practically any size. It all depends on how much information they store.


What is java string?

array of character data type which is terminated by null character


What is component size in java?

Component size is the size that a component appears in a GUI.


Why does a character in Java take twice as much space to store as a character in C?

Different languages use different size types for different reasons. In this case, the difference is between ASCII and Unicode. Java characters use 2-bytes to store a Unicode character so as to allow a wider variety of characters in strings, whereas C, at least by default, only uses 1 byte to store a character.


How do you increase java heap size on mobile phones?

How do increase java heap space on mobile


Character use only one byte why Java use two byte for character?

The number of bytes used by a character varies from language to language. Java uses a 16-bit (two-byte) character so that it can represent many non-Latin characters in the Unicode character set.


Why does java use unicode?

Transform character s into numbers (binary)


Is Will Smith a robot?

In the movie iRobot, no. His character was more of a mechanically enhanced human.


What will be if java program is being shifted from 64 bit machine to 32 bit machine?

A Java program should run on any platform (hardware + operating system) for which a JVM (Java Virtual Machine) is installed. Unlike the "C" language, the size of data items in Java does not depend on the platform; for example, an int will always have a size of 32 bits, no matter how the underlying computer hardware is organized.A Java program should run on any platform (hardware + operating system) for which a JVM (Java Virtual Machine) is installed. Unlike the "C" language, the size of data items in Java does not depend on the platform; for example, an int will always have a size of 32 bits, no matter how the underlying computer hardware is organized.A Java program should run on any platform (hardware + operating system) for which a JVM (Java Virtual Machine) is installed. Unlike the "C" language, the size of data items in Java does not depend on the platform; for example, an int will always have a size of 32 bits, no matter how the underlying computer hardware is organized.A Java program should run on any platform (hardware + operating system) for which a JVM (Java Virtual Machine) is installed. Unlike the "C" language, the size of data items in Java does not depend on the platform; for example, an int will always have a size of 32 bits, no matter how the underlying computer hardware is organized.


Program for length of list in java?

Java's List interface defines the size() method, which can be used to retrieve the length of a list.