Java Program to input an integer , a decimal number and a String using Buffered Reader and then print it - HackerRank


 

// Program by Akash Tripathi (@proakash256) 
import java.io.*;
public class Input_Scanner2
{
    public static void main(String[] argsthrows IOException
    {
        BufferedReader sc = new BufferedReader 
(new InputStreamReader(System.in));
        int i = Integer.parseInt(sc.readLine());
        double d = Double.parseDouble(sc.readLine());
        String s = sc.readLine();
        sc.close();
        System.out.println("String: " + s);
        System.out.println("Double: " + d);
        System.out.println("Int: " + i);
    }
}

Comments