Java tutorial
//package com.java2s; //License from project: Apache License import android.util.Log; public class Main { public static int factorial(int num) { Log.d("factorial", String.valueOf(num)); if (num == 0) return 0; else if (num == 1) return 1; else return num * factorial(num - 1); } }