Complete the code to declare a variable that can hold a decimal number.
double number = [1];The variable number is declared as double, so it must be assigned a decimal number like 5.5.
Complete the code to promote an int to a double by assignment.
int i = 10; double d = [1];
Assigning an int variable i directly to a double variable d promotes the int to double automatically.
Complete the code to promote a byte to an int using the correct cast.
byte b = 5; int i = [1] b;
To promote a byte to an int, you can cast it explicitly with (int).
Fill both blanks to create a conditional that promotes a short to int and compares it.
short s = 10; if ([1] s [2] 5) { System.out.println("Greater"); }
The short variable s is promoted to int by casting (int), then compared if greater than 5 using >.
Fill all three blanks to create a map with keys promoted to uppercase strings and values filtered by condition.
Map<String, Integer> result = Map.of(
"a", 1,
"b", 2,
"c", 3
).entrySet().stream()
.filter(e -> e.getValue() [1] 1)
.collect(Collectors.toMap(
e -> e.getKey()[2],
e -> e.getValue() [3] 1
));The code filters entries with values greater than 1, promotes keys to uppercase using .toUpperCase(), and increments values by 1.