giving me null values for both name and no.not allow to enter through keyboard with this code.
package com.codegym.task.task03.task0318;
/*
Plan to conquer the world
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
String s1 = "Mwa-ha-ha!";
String name,no;
int yrs=0;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try{
System.out.println("Enter your name: ");
name = reader.readLine();
System.out.println("Enter a no: ");
no = reader.readLine();
yrs = Integer.parseInt(no);
System.out.print(name +" will take over the world in" +yrs +" years." +s1);
}
catch (Exception e) {
e.printStackTrace();
}
}
}