how after the execution of if block in the whole program, the statement "System.out.println("after method showValue\t:"+ab);" is still able to fetch previous values ? i thought this statement will print 0 everytime but its not happening ?
public class Me{
public static void main(String[] args) {
int ab=98;
System.out.println(" value of ab in main at start\t:"+ab);
Mno ref=new Mno();
ref.showValue(ab);
System.out.println("value of ab in Main After completion\t:"+ab);
}
}
class Mno{
void showValue(int ab){
System.out.println("Before method showvalue\t:"+ab);
if (ab!=0){
showValue(ab/10);}
System.out.println("after method showValue\t:"+ab);
}
}