The pages of this web site are not formatted to conserve paper, but my new book (ISBN: 0-9745862-0-X) is formatted to save paper, save your printer cartridge, save a loose-leaf binder, and save money. If you prefer to work my exams from printed pages, then give your printer a rest and buy my new book.
Today, you can find my book at amazon.com.
| No. | Answer | Remark | |
|---|---|---|---|
| 1 | d | Prints: true,true | An int is a 32-bit signed integral value that is stored in two's complement format. The left most bit is the sign bit. The sign bit is set to one for negative numbers and is set to zero for positive numbers. |
| 2 | a b c d e | doubleValue floatValue intValue longValue parseDouble | |
| 3 | c | Prints: true,false |
|
| 4 | b | Prints: ffF | |
| 5 | f | Prints: BbB |
The
|
| 6 | c | Compile-time error |
The
|
| 7 | g | Prints: true,true,false |
|
| 8 | g | valueOf | |
| 9 | b d e | Long.parseLong("1L") Long.parseLong("0x10") Long.parseLong("1.0") |
|
| 10 | e | Prints: true,false,false |
|
| 11 | e f | parseDouble valueOf | |
| 12 | b d e | Long.parseLong("+1") Long.parseLong("1L") Long.parseLong("1.0") |
|
| 13 | a b | intValue parseInt |
|
| 14 | e g | parseDouble valueOf | |
| 15 | c | Prints: true,false |
|
| 16 | f | Run-time error | An argument of type String must represent a floating-point value. The argument "0x10" represents a hexadecimal integer literal; so a NumberFormatException would be thrown at run-time. |
| 17 | b | Prints: false,true |
|
| 18 | b d | Compile-time error at 2. Compile-time error at 4. |
The
|