2.9.1 Integer Types: byte (8), Short (16-bit), Char (16-bit), INT (32-bit), long (64-bit). Assigning a number of digits to a number of points, and requires explicit conversion, it is also called Force Type Conversion (CAST). Teconate begins in 1-9. Octa starts with 0. The hexadecimal starts with 0x. To indicate that constants is the long type, not the int type, you need to add letters L after it. It's not clear here. Is it written in the program, or say this? "14084591234L - a long-type decimal constant. No l is wrong, because 32-bit int type integers cannot store such a large number." This sentence has a sentence implies, that is, if the program is used in the program Integer constants, this constant is the int type because the integer constant is not declared (there is no statement this to declare it? Int 456). So, if you use a number exceeding the INT type, you should add L after the number, so that the system knows this is a log type number. 2.9.2 Floating point type floating point number consists of 3 parts: symbol, magnitude, and exponent. Java supports two types of floating point (FLOAT-32, Double-64). Unless otherwise stated, floating-point type constants are Double types (as if the entire default is Int). Specifies the constant of the FLOAT type, add f or f after constants. I think it is better to write uppercase. 2.9.3 CHAR type character constant is caused by single quotes, such as 'A'. String constants Even if there is only one letter, it is also a string, with double quotes, "a". And some difficult characters need to use the escape character, although it is necessary to write two characters, but is still '/ t', single quotes. Another way to write characters constant is to use hexadecimal transfusion sequences such as '/ u0007'. (25 pages in the book, the '/ u007' is missing, it is impossible to compile 65536 Unicode characters written from '/ u0000' to '/ uffff'. The following program can "print" a system bell, of course, not seeing on the screen, but listening to the ear.
// eXample.java class example {public static void main (string [] args) {system.out.print ('/ u0007');}} However, if it is changed to '/ u000d', it will be reported when compiling.
E: / Program Files / J2SDK1.4.2 / Application> Javac Example.javaexample.java: 7: Illegal line end in character literal system.out.print ('/ u000d'); ^ 1 Error Why? Or should I have a return? ? ? 2.9.4 Comparison of digital and strings Java requires programmers to point out the type of each variable, like Java, language with similar characteristics into a strongly typed language.