Java data type

xiaoxiao2021-03-06  40

The Java language is a strict Java language that provides eight basic classes and a Boolean. Java additional "type" language. This means each type. Six digital types (four integers also provide large digital objects, but it is not a JA variable must have a good type. Two floating point), a character type, VA's data type.

1, integer:

Definition: There is no number of numbers, negative numbers are allowed.

Type: Java provides four integer types:

INT 4 bytes-2, 147, 483, 648 to 2, 147, 483, 647

Hort 2 bytes -32, 768 to 32, 767

LONG 8 bytes -9, 223, 372, 036, 854, 775, 808L to 9, 223, 372, 036, 854, 775, 807L

BYTE 2 bytes -128 to 127

2, floating point:

Definition: The number containing the fractional portion.

Category: Java provides two floating point numbers:

FLOAT 4 bytes of approximately 3.40282347E 38F (6 ~ 7 effective decimal number)

Double 8 bytes of approximately 1.79769313486231570e 308 (15 effective digits)

Description:

1) The value of the Float type has a suffix: f, the value can also use the suffix D. If there is no suffix f, then the default is Double. Double type

2) When these numbers encounter the underflow value range errors, it occurs (over overflow ov.erflow); when encountered, when the image is zero,

3, character type:

Definition: Single quotes are used to represent Char constants,

Description:

1) Double quotes indicate a string, he is an object of Java, not a data type.

2) Char type represents characters in the Unicode coding scheme.

Unicode can include 65536 characters, AS subsets. Unicode characters typically use hexadecimal encoding to / u00FF to represent ASCII / ANSI characters. / u indicates that this CII / ANSI contains only 255 characters, actually a solution of Unicode represents, between '/ u0000' to '/ uffff'. / u0000 is a Unicode value.

3) In addition to the form of the character in Java, it is also possible to use a modified sequence to represent a special character.

/ B retracted / u0008

/ T Tab Table / U0009

/ N wrap / u000A

/ r hard back / u000d

/ "Dual quotation mark / u0022

/ 'Single number / u0027

/ Backslash / u005C

4) In theory, in Java should be displayed, it depends on the use of Unicapi and operating systems in the usage program and the approve, where operates ODE characters, but as they can really system is the most fundamental.

4, Boolean type:

The Boolean type is only two values: False and True, friends who have used other programming languages ​​must be unfamiliar with them.

转载请注明原文地址:https://www.9cbs.com/read-64234.html

New Post(0)