This is some tricky question
Lets say below code
public int getValue()
{
try
{
return 2;
}
finally
{
return 3;
}
}
when called the above method System.out.println(getValue()) what is the output
It always returns thr finally return , i.e the answer is 3
Lets say below code
public int getValue()
{
try
{
return 2;
}
finally
{
return 3;
}
}
when called the above method System.out.println(getValue()) what is the output
It always returns thr finally return , i.e the answer is 3
No comments:
Post a Comment