I have used BufferedReader and I have written a code, whose output doesn`t match the code. I need to somehow assign a value to name and y, even though it´s supposed to be read from the keyboard. Can anyone help?
package com.codegym.task.task03.task0318;
/*
Plan to conquer the world
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
String name = scan.readLine();
String num = scan.readLine();
int y = Integer.parseInt(num);
System.out.println(name+" will take over the world in "+ y+" years. Mwa-ha-ha!");
}
}