Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

scanner example java, full name

import java.util.Scanner;

public class FullNameLetters {
    public static void main(String[] args) {
        System.out.println ("Enter the name: ");
        Scanner S1 = new Scanner(System.in);
        String name = S1.nextLine();
        System.out.println("Enter the last name: ");
        Scanner S2 = new Scanner(System.in);
        String lastname = S2.nextLine();
        int fullln = name.length() + lastname.length();
        System.out.println(fullln);
    }
}
 
PREVIOUS NEXT
Tagged: #scanner #full
ADD COMMENT
Topic
Name
9+7 =