class Wow{
public static void main(String[] args) {
int ab = 98;
System.out .println("ab in Main Before\t:" + ab);
Mno ref = new Mno();
ref.showValue(ab);
System.out .println("ab in Main After\t:" + ab);
}
}
class Mno {
void showValue(int ab) {
System.out .println("Before showValue\t:" + ab);
if (ab != 0)
showValue(ab / 10);
System.out .println("After showValue \t:" + ab);
}
}
output
ab in Main Before :98
Before showValue :98
Before showValue :9
Before showValue :0
After showValue :0
After showValue :9
After showValue :98
ab in Main After :98