Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare a primitive integer variable.
Java
int number = [1];🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
2fill in blank
mediumComplete the code to create a reference to a String object.
Java
String text = [1];🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
3fill in blank
hardFix the error in the code to assign a new Integer object to a variable.
Java
Integer value = [1];🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
4fill in blank
hardFill both blanks to create an array of primitive ints and assign a value.
Java
int[] numbers = new int[[1]]; numbers[[2]] = 5;
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a String array, assign a value, and print it.
Java
String[] words = new String[[1]]; words[[2]] = [3]; System.out.println(words[0]);
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
