Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to convert an int primitive to an Integer object.
Java
int num = 10; Integer obj = [1];
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
2fill in blank
mediumComplete the code to convert a double primitive to a Double object.
Java
double val = 5.5; Double obj = [1];
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
3fill in blank
hardFix the error in converting a boolean primitive to a Boolean object.
Java
boolean flag = true;
Boolean obj = [1];🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
4fill in blank
hardFill both blanks to convert a char primitive to a Character object and print it.
Java
char ch = 'a'; Character obj = [1]; System.out.println([2]);
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a Float object from a float primitive, check equality, and print the result.
Java
float f1 = 3.14f; Float obj1 = [1]; Float obj2 = [2]; boolean isEqual = obj1.[3](obj2); System.out.println(isEqual);
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
