Results 1 to 1 of 1
-
How to read input from the console
This example code reads a line from the standard input(console) using the BufferedReader and InputStreamReader.
Java Code:import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class InputExp { public static void main(String[] args) { try { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); System.out.println("Enter the line :- "); String s = br.readLine(); System.out.println("You have Enterd :- " + s); } catch (IOException e) { e.printStackTrace(); } } }
Similar Threads
-
How to get input from Console
By karma in forum New To JavaReplies: 8Last Post: 08-13-2010, 09:32 PM -
How to read input from console
By Java Tip in forum java.ioReplies: 0Last Post: 04-16-2008, 10:57 PM -
Read from console (Scanner Class)
By hey in forum New To JavaReplies: 10Last Post: 12-11-2007, 10:11 PM -
Taking input from console
By Java Tip in forum Java TipReplies: 0Last Post: 11-05-2007, 04:47 PM -
how to take input and verify input in Java programs
By bilal_ali_java in forum Advanced JavaReplies: 0Last Post: 07-21-2007, 08:46 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks