Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new String with the value "Hello".
Java
String greeting = new String([1]);🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
2fill in blank
mediumComplete the code to create a String variable named name with the value "Alice".
Java
String name = [1];🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
3fill in blank
hardFix the error in the code to correctly create a String with the text "Java".
Java
String lang = new String([1]);🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
4fill in blank
hardFill both blanks to create a String variable called message with the value "Welcome".
Java
String [1] = new [2]("Welcome");
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a String variable named text with the value "Code" using the constructor.
Java
String [1] = new [2]([3]);
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
