Update this code using the new pattern matching features.
Computer scienceProgramming languagesJavaCode organizationObject-oriented programmingClass hierarchiesBuilding class hierarchies
Runtime type checking
Pattern matching in practice
Report a typo
Sample Input 1:
Hello Java DevelopersSample Output 1:
The variable is not empty, the length is 21Write a program in Java 17
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Object msg = scanner.nextLine();
// Write your code here
}
}
___
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.