class Test
{
void studentDetails()
{
try
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("please enter student name");
String sname=br.readLine();
System.out.println("hi "+sname);
}
catch(IOException e)
{
System.out.println("we are getting Exception"+e);
}
}
public static void main(String[] args)
{
Test s1=new Test();
s1.studentDetails();
}
}
import java.io.*;
class Test
{
void studentDetails()throws IOException
{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("please enter student name");
String sname=br.readLine();
System.out.println(" hi :"+sname);
}
public static void main(String[] args)throws IOException
{
Test s1=new Test();
s1.studentDetails();
}
}
Our website is made possible by displaying ads to our visitors.
Please help us continue to provide you with free. So please disabling your ad blocker.