So you know Delphi or Java and want to learn the other language? A very important thing to know is what datatypes you are using, as these differ in each language.
As you may know, Java does not have any unsigned datatypes, Delphi however has both signed and unsigned datatypes. Because of this the unsigned types are not listed in the table below, but in order for the integer types these are Byte/UInt8, Word/UInt16, Cardinal/LongWord/UInt32, UInt64. Delphi also has ansi strings/chars, these can be stores in string and Char but those can also hold unicode versions, the actual ansi types are AnsiString and AnsiChar. And of course Delphi also comes with a Pointer type as well as it has the ability to create types that hold pointers to specific types.
Java | Delphi | Type | Data |
---|---|---|---|
byte | ShortInt, Int8 | 8-bit signed integer | -128 to 127 |
short | SmallInt, Int16 | 16-bit signed integer | -32768 to 32767 |
int | Integer, LongInt, Int32 | 32-bit signed integer | -2147483648 to 2147483647 |
long | Int64 | 64-bit signed integer | -9223372036854775808 to 9223372036854775807 |
float | Single | 32-bit floating point value | |
double | Double | 64-bit floating point value | |
boolean | Boolean | boolean value | true or false |
char | Char (stores both ansi and unicode chars), WideChar, UnicodeChar | 16-bit unicode character | a single unicode character |
String | string (stores both ansi and unicode strings), Widestring, UnicodeString | unicode string | a string consisting out of unicode characters |
Object | TObject | an object | object pointer |