|
Examples:
|
|
Example:
String s1 = "abc"; // = an array of 3 ASCII codes (for 'a', 'b', 'c') String s2 = "123"; // = an array of 3 ASCII codes (for '1', '2', '3') char c = 'H'; s1 + s2 = "abc123" // an array of 6 ASCII codes s1 + c = "abcH" // an array of 4 ASCII codes |
|
int x; x = 0; // Java compiler generates instructions that store // 00000000000000000000000000000000 into variable x x = 4; // Java compiler generates instructions that store // 00000000000000000000000000000100 into variable x x = x + 1 // Java compiler generates instructions that // add binary number in x with 00000000000000000000000000000001 x = -x; // Java compiler generates instructions that // inverts the binary number in x and store result in x |
A concrete example:
int x; x = 0; // variable x contains: 00000000000000000000000000000000 x = 4; // variable x contains: 00000000000000000000000000000100 x = x + 1; // variable x contains: 00000000000000000000000000000101 ( 52's compl ) x = -x; // variable x contains: 11111111111111111111111111111011 ( -52's compl ) |