1. 首页
  2. 文档大全

3.3--数据类型和变量.doc

上传者:蓝天 2022-06-08 14:15:15上传 DOC文件 84 KB
3. 3—数据类型和变量
Introduction: in Java, data types are divided into basic types and reference types (see Figure)
Basic data types
In 1 and Java, there are currently 8 basic data types, memory size, value range, and default values (see Figure)
l>boolean
Taking the Java virtual machine bytecode compiler for Boolean, with an arbitrary nonzero integer that represents true, 0 false
This way 一 > bottom is transparent to the Java source program
2>byte\short\int\long
Taking are integer types of symbols
unsigned integers convert all bits of a binary number into positive integers
has signed integer, which takes the first place of binary as symbol bit
selects the appropriate integer type: consider the actual requirements (memory resources) and the performance of the program (forcing)
to an integer variable assignment: automatic conversion
(small cast (一 > big) big / small)
assignment of long integers: Long, I = 500L or 5001:
Java allows 8 hexadecimal (start with 0), 16 hexadecimal (start with Ox), 10 decimal to integer type variables
3>char\ character encoding
一 > character encoding
ASCII is a set of code for the Rome alphabet, with 7 bits in one byte
ISO-8859-1 encodes custom characters for Western European languages, using 8 bits per byte, compatible with ASCII
GB2312 encodes simplified Chinese characters, including 7445 characters, 6763 Chinese characters, and 682 oth

3.3--数据类型和变量


文档来源:https://www.taodocs.com/p-690274990.html

文档标签:

下载地址