Java Stdin and Stdout II

  • + 2 comments

    So I think this challenge was also meant to teach that you will have to get comfortable with looking for helpful solutions to aid in overcoming challenges now and in the furture.

    I ended up not even using the Scanner Class altogether but Integer.parseInt() was what was needed regardless.

    import java.io.*;
    
    public class Solution {
    
        public static void main(String[] args) throws IOException{
            BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
            int i = Integer.parseInt(scan.readLine());
            double d = Double.parseDouble(scan.readLine());
            String s = scan.readLine();
    
            System.out.println("String: " + s);
            System.out.println("Double: " + d);
            System.out.println("Int: " + i);
        }
    }