Advertisement
n0tmE

factorial calculation utility class

Jun 6th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.17 KB | None | 0 0
  1. package com.example.utils;
  2.  
  3. public class MyMath {
  4.     public static long Factorial(long l) {
  5.         if (l > 1)
  6.             return l * Factorial(l - 1);
  7.         else
  8.             return 1;
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement