Correct the code so it doesn't throw an exception.
NullPointerException
Unknown input
Report a typo
Write a program in Java 17
class Util {
// correct this method to avoid NPE
public static void printLength(String name) {
System.out.println(name.length());
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.