public void testFinally(){
System.out.println(setOne().toString());
}
protected StringBuilder setOne(){
StringBuilder builder=new StringBuilder();
try{
builder.append("Cool");
return builder.append("Return");
}finally{
builder=null; /* ;) */
}
}
why output is CoolReturn, not null?
Regards,
Mahendra Athneria
builder.append("some value");
modify the actual returned value whilebuilder = null
not? – Reticle