JavaPatternMatching/resources/javFiles/FacultyIf.jav

18 lines
221 B
Java

import java.lang.Integer;
class Faculty {
m () {
var fact = (Integer x) -> {
if (x == 1) {
return x;
}
else {
return x * (fact.apply(x-1));
}
};
return fact;
}
}