Complete the code to create a new String object in Java.
String greeting = new [1]("Hello");
In Java, the class name String must be capitalized to create a new String object.
Complete the code to compare two strings for equality in Java.
if (str1.[1](str2)) { System.out.println("Equal"); }
Use equals() method to compare string contents in Java.
Fix the error in the code to concatenate two strings correctly.
String fullName = firstName [1] lastName;In Java, the '+' operator concatenates strings.
Fill both blanks to create a substring from index 2 to 5.
String part = text.[1]([2], 6);
Java uses substring(startIndex, endIndex) to get part of a string. Index 2 is the start.
Fill all three blanks to convert a string to uppercase and check if it equals "HELLO".
if (input.[1]().[2]("HELLO") [3] true) { System.out.println("Match"); }
Convert string to uppercase with toUpperCase(), then compare with equals(). The '==' compares boolean true.
