Java examples for Language Basics:Console
Reads a long from console
//package com.java2s; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { private static BufferedReader buffer = new BufferedReader( new InputStreamReader(System.in)); /**/*from www .j a v a 2 s . c o m*/ * Reads a long from console * * @return the read long * @throws IOException * If an IO error occurs */ public static long readLong() throws IOException { return Long.parseLong(buffer.readLine()); } }