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