Java Program 12 – Read Input From Keyboard

Program

import java.io.*;

class TestBuffer{

    public static void main(String args[])throws Exception{
    
        InputStreamReader in=new InputStreamReader(System.in);
        BufferedReader br=new BufferedReader(in);
        String msg=br.readLine();
        System.out.println(msg);
    }

}


Output

D:\a5518\day6>javac TestBuffer.java

D:\a5518\day6>java TestBuffer

jijo
jijo

D:\a5518\day6>


 

You can leave a response, or trackback from your own site.

Leave a Reply