Try this piece of code. Why does getValueB() return 1 instead of 2? After all, the increment() function is getting called twice.
public class ReturningF
the finally block in GetValue2 method does not return anything. It's only calling the method to increment counter.
finally
GetValue2
counter