Classification constants and their respective characteristics, precautions constant printout

1, the constant classification and characteristics

(1) Character Constants: double quotes portion.

(2) integer constant: to write directly on the numbers, no decimal point.

(3) floating-point constants: write directly on the digital, contain a decimal point.

(4) character constants: due to a single character in single quotes (containing only one character)

(5) Boolean constants: true, flase (containing only these two values)

(6) empty constants: null (means no data)

2 Notes constants printout

(1) between the double-quoted string may be empty.

(2) can not be empty between the single quote character.

Note: between the single quote character can be a space, but can not write more characters in a row, only to write one.

(3) Air Constant not be directly used to print output.

3, for example Code

(1) source

(2) Run results

Guess you like

Origin www.cnblogs.com/MurasameLory-chenyulong/p/12555067.html