public class UseTry
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String getName()
{
try
{
return br.readLine();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
It gives an error "Method must return a result of type string" ..There is a solution if i explicitly throw Exception Like this
String getName() throws IOException
{
return br.readLine();
}
No error here..but the problem is that my program requires i should not explicitly throw the exception...
Can u all suggest sumthing to rectify this problem..
Thanks :)

