Hi all,
I want explanation for the output of following programme
,the output is 35, but i was expecting it to be 10 since finally gets
excuted at the end
public class testfinal {
static int dist=0;
public static int getresult(){
try{
dist=35;
return dist;
}
finally{
dist=12;
}
}
public static void main(String args[]) {
int j=getresult();
System.out.println(" dist " + j );
}
}
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
To unsubscribe from this group, send email to
javaprogrammingwithpassion+unsubscribegooglegroups.com or reply to this email
with the words "REMOVE ME" as the subject.