I recently started working with Eclipse for Android development. When debugging the code, I noticed one strange behavior (at least compared to Visual Studio): after you press the return statement in the middle of the function, it does not immediately return, but always jumps to the last return statement. For instance:
String getTest(int i){ if (i == 0) return "0"; return "-1"; }
Given i = 0, after pressing the first return statement, instead of moving from this function, it moves on to the next return statement. However, it returns "0", not "-1". So why this dummy step? It bothers me. Can anyone explain why?
source share