what will be the out put of the below method in case of Exception and No Exception?
public int someMethod(int a )throws Exception
{
try
{
// Some Code
if(a==0)
throw new SomeException();
return 1;
}
catch(Exception e)
{
return 2;
}
finally
{
return 3;
}
}
Sol- It always return 3;
public int someMethod(int a )throws Exception
{
try
{
// Some Code
if(a==0)
throw new SomeException();
return 1;
}
catch(Exception e)
{
return 2;
}
finally
{
return 3;
}
}
Sol- It always return 3;