Java examples for Language Basics:Console
read String Line from Console
//package com.java2s; import java.util.Scanner; public class Main { public static void main(String[] argv) throws Exception { System.out.println(readStringLine()); }/*w w w. j a v a 2s . co m*/ public static String readStringLine() { return new Scanner(System.in).nextLine().trim(); } }