class Fact{ void fact (int x) { if(n==0 || n==1) return 1; else return x*fact(n-1); } } class Example11 { public static void main(string[] args) { Fact obj=new Fact(); int result; result=obj.fact(5); System.out.print("the factorial ="+result); } }