how to read a string from user input

htt‮.www//:sp‬lautturi.com
how to read a string from user input
/**
 * @author lautturi.com 
 * Java example: read user input to a string
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {
		// get input from system standard input
		Scanner myObj = new Scanner(System.in);
	    System.out.println("Enter name");

	    String userName = myObj.nextLine(); 
	    System.out.println("The name is: " + userName); 

	}
}
Created Time:2017-09-25 10:27:35  Author:lautturi