In the scenario below how what happens with regards to GC? I'm pretty sure the reference to "a" will not actually get returned, hence no need to worry about leaving this reference in scope. So pretty much the return of "a" never actually takes place and therefore goes out of scope and only "b" is ever returned?
Object testFinally(){
try {
Object a = new Object();
return a;
} finally {
Object b = new Object();
return b;
}
}
void callToTestFinally(){
Object v = testFinally();
}