Does anyone have a clue about the last piece of code that I posted. 4 string objects are being created and I wanted to be sure that they WILL be GC'd. TIA
i is assigned to the returned value of getInt() which returns k+1
I dont see any addition taking place here. What I do see is concatenation k + i where k is zero at that time. yes the return of the method is i but again where is this 1 at?
A: initializing i to getInt() where k hasnt been initialized yet at this point, its zero. however, how is "1" being returned and printed? B: prints ret value of method which is 1 and the value of k member var which is 20
I can see how this dg matrix holds two rg objects. Nevertheless since rg is set to null, the return value would be null, no? Could you tell me if Case 1 is correct?