Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get string input line in java

class me{
    public static void main(String[] args) {
        name();
    }
    public static void name(){
        Scanner input = new Scanner(System.in);
        System.out.print("Enter your name :");
        String full_name = input.nextLine();
        System.out.println("hi "+ full_name+", Welcome back !");
    }
 
PREVIOUS NEXT
Tagged: #string #input #line #java
ADD COMMENT
Topic
Name
6+4 =