vendredi 13 mars 2015

Why does this method print out 347 rather than 3?



Suppose I have the method



public static void whatsIt(int n){
if (n>10)
whatsIt(n/10);
System.out.print(n%10);
}


and I call whatsIt(347), why does it print 347 instead of 3?




Aucun commentaire:

Enregistrer un commentaire