JAVA Program to Accept Value using Buffered Reader

JAVA Program to Accept Value using Buffered Reader:


import java.io.*;
class buffrdredr
{
 public static void main(String args[]) throws IOException
 {
 BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
 System.out.println("Enter any String ");
 String a=br.readLine();
 System.out.println("Enter any Number ");
 int b=Integer.parseInt(br.readLine());
 System.out.println("String is: "+a);
 System.out.println("Number is: "+b);
 }
}

OUTPUT:

Enter any String
BaronTuts
Enter any Number
88
String is: BaronTuts
Number is: 88



Leave a Reply

Your email address will not be published. Required fields are marked *

three × 2 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.