Pattern matching in practice

Report a typo

Update this code using the new pattern matching features. TypeCheckingDemo class

Sample Input 1:

Hello Java Developers

Sample Output 1:

The variable is not empty, the length is 21
Write 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
}
}
___

Create a free account to access the full topic