in this code there is no compilation error but , it is not reading input or the execution is not going beyond first input statement .
i am used to scanner and unable to understand the problem is.
code:_
import java.util.;
import java.lang.;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws IOException
{
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
while(true)
{ try
{
System.out.println(“abc”);
int t= Integer.parseInt(br.readLine()); \gets exectuted
System.out.println(t);
for(int i=0;i<t;i++)
{
System.out.println(t);
int k= Integer.parseInt(br.readLine()); \does not gets executed
System.out.println(k);
System.out.println(t);
}
}
catch(Exception e)
{
return;
}
}}
}
In the above code when i give input for just ‘t’ all the print statement get executed , but when input ‘t’ and ‘k’ is given the output is only “abc”.