-It does read the numbers from the keyboard
-There is only one main method (this one is valid)
-The program displays a string that starts with "Sum ="
-And it ends with the sum of the entered numbers.
Maybe I have done something wrong but I struggle to find what, my code seems to be valid.
package com.codegym.task.task05.task0530;
import java.io.*;
/*
Boss, something weird is happening
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in),2);
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int sum = a + b;
System.out.println("Sum = " + sum);
}
}
InputStremReaderBufferdReader named sz (mnemonic for "size" I think) that constrain the number of input it will read.