Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a string variable named greeting.
Java
String greeting = [1];🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
2fill in blank
mediumComplete the code to compare two strings for equality.
Java
if (str1.[1](str2)) { System.out.println("Strings are equal"); }
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
3fill in blank
hardFix the error in the code to concatenate two strings correctly.
Java
String fullName = firstName [1] lastName;🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
4fill in blank
hardFill both blanks to create a string and get its length.
Java
String word = [1]; int length = word.[2]();
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
5fill in blank
hardFill all three blanks to check if a string starts with a letter and convert it to uppercase.
Java
if (text.[1]("A")) { String upper = text.[2](); System.out.println(upper.[3]()); }
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
