Java Scanner next() Method - Java leer input cadena de texto

PHOTO EMBED

Thu Sep 23 2021 00:55:34 GMT+0000 (UTC)

Saved by @drack669 #java

System.out.print("Enter full name: ");        
        //Create scanner object and read the value from the console  
        Scanner scan = new Scanner(System.in);  
        //Read the first token  
        String firstName = scan.next();  
        //Read the second token  
        String lastName = scan.next();  
        //Print the token values read by Scanner object  
        System.out.println("First Name is: "+firstName);  
        System.out.println("Last Name is: "+lastName);    
        scan.close();  
content_copyCOPY

captura de cadena de texto en java

https://www.javatpoint.com/post/java-scanner-next-method