Java language data types

1.Java programming language has eight primitive data types can be divided into four kinds of integer, floating point, character data and Boolean data type will not change with the computer, referred to as: eight kinds of four types
1. type integer
integer class: A byte, B.short, c.int, D.long complement code storage
a.byte byte integer 1B -128 to 127
bshort short integer 2B -32768 to 32767
c.int integer 4B - 2147483648 to 2147483647
d.long long 8B -9223372036854775808 to 9223372036854775807
2. the float type
two kinds of floating-point type X.float (single precision) and Y.double (double precision) floating-point number can not be accurately stored, it can not float Analyzing equivalent
x.float 4B single-precision floating-point data valid 7-8 E38
Y. 8B double double precision floating point data valid 15-16 E308
3. char character type
with char type can represent a single character, the characters are in single quotes [stressed up a character: not use double quotation marks, double quotes] type is the string, the character may be a character data encoding unicode character set is any character .Java 16 (2B) unsigned data, it represents a set of Unicode, Not just the ASCII set. Range 0 to 65535.
4. The logical type boolean
boolean data type has two literal values: true and false false true in the Java programming language boolean type only allows the use of a boolean value, no conversion between integer boolean type and type of computing

发布了12 篇原创文章 · 获赞 10 · 访问量 317

Guess you like

Origin blog.csdn.net/qq_45874107/article/details/104596816