java factorial class