Java Reference
In-Depth Information
over 65,000 characters) was chosen. It was thought to leave ample space for
expansion for esoteric scripts, such as Egyptian hieroglyphs and the ancient script
used on the island of Java.
Java was one of the first programming languages to embrace Unicode. The
primitive type char denotes a 2-byte Unicode character. (All Unicode characters
can be stored in Java strings, but which ones can actually be displayed depends on
your computer system.)
A Menu with Chinese Characters
164
165
Unfortunately, in 2003, the inevitable happened. Another large batch of Chinese
ideographs had to be added to Unicode, pushing it beyond the 16-bit limit. Now,
some characters need to be encoded with a pair of char values.
4.7 Reading Input
The Java programs that you have made so far have constructed objects, called
methods, printed results, and exited. They were not interactive and took no user input.
In this section, you will learn one method for reading user input.
Use the Scanner class to read keyboard input in a console window.
Because output is sent to System.out , you might think that you use System.in
for input. Unfortunately, it isn't quite that simple. When Java was first designed, not
Search WWH ::




Custom Search