Delphi comparison with basic data types JAVA
Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
**Delphi与JAVA基本数据类型对比**
- 1
Types of | Delphi keyword | JAVA keyword | byte | Remark | range |
---|---|---|---|---|---|
Integer | Shortint | byte | 1 | Signed 8 | -128..127 |
Byte | 1 | Unsigned 8 | 0 .. 255 | ||
Smallint | short | 2 | Signed 16 | -2^15..2^15-1 | |
Word | 2 | Unsigned 16 | 0 .. 65535 | ||
Longint | int | 4 | Signed 32 | -2^63..2^63-1 | |
Longword | 4 | Unsigned 32-bit | 0 .. 4294967295 | ||
Integer | int | 4 | Signed 32 | -2^63..2^63-1 | |
Cardinal | 4 | Unsigned 32-bit | 0 .. 4294967295 | ||
int64 | long | 8 | Signed 64 | -2^63 .. 2^63 |
—————————————————————————————————-
Types of | Delphi keyword | JAVA keyword | byte | Remark | range |
---|---|---|---|---|---|
character | AnsiChar (char) | 1 | 8th | ANSI character set | |
WideChar | char | 2 | # 16 | Unicode character set |
—————————————————————————————————-
Types of | Delphi keyword | JAVA keyword | byte | Remark | range |
---|---|---|---|---|---|
Boolean | Boolean | boolean | 1 | 8th | Ord (false) = 0, Ord (true) = 1) java substantially not converted to other data types |
ByteBool | 1 | 8th | Words (false) = 0, words (true) <> 0) | ||
WordBool | 2 | # 16 | Words (false) = 0, words (true) <> 0) | ||
LongBool | 4 | # 32 | Words (false) = 0, words (true) <> 0) |
—————————————————————————————————-
Types of | Delphi keyword | JAVA keyword | byte | Remark | range |
---|---|---|---|---|---|
Real | Real | 8 | Accuracy 15..16 | ||
Real48 | 6 | Accuracy 11..12 backward compatibility | |||
Single | float | 4 | Accuracy 7..8 | ||
Double | double | 8 | Accuracy 15..16 | ||
Extended | 10 | Accuracy 19..20 | |||
Comp | 8 | Accuracy 19..20 | |||
Currency | 8 | Accuracy 19..20 |
----------------------------------
string does not belong to the basic data types
Types of | Delphi keyword | JAVA keyword | byte | Remark | range |
---|---|---|---|---|---|
String | Short String | 255 characters | ANSIChar type (standard character type) | 2..256B | |
AnsiString | 2 ^ 31 characters | ANSIChar type | 4B..2GB | ||
WideString | About 2 ^ 30 characters | WideChar character type | 4B..2GB | ||
String | String String, depending on the value of the compiled instructions, $$ H + (indeed province) represents a long string (The ANSIString type) $ H-Representative ShortString |
—————————————————————————————————-