Output:18 3
| x | y |
|---|---|
| 4 | 7 |
| 18 | 7 |
| 18 | -8 |
| 6 | 6 |
| 3 |   |
| Format String | Digits After Decimal Point? |
Always Show Leading Digit? | Commas? |
|---|---|---|---|
| "#0.0000" | 4 | Yes | No |
| "#.000" | 3 | No | No |
| "#,##0.00" | 2 | Yes | Yes |
| "#,###.0" | 1 | No | Yes |
// Version 1. Use declaration and assignment,
// Version 2. Use initialization
// Version 3. Use declaration and assignment,
// Version 4. Use initialization with
// with full String constructor call.
String state;
state = new String("Illinois");
// with full String constructor call.
String state = new String("Illinois");
// with short cut String creation.
String state;
state = "Illinois";
// with short cut String creation.
String state = "Illinois";
Answer: