Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Java
Function<Integer,Integer> squareFunction = x -> x * x;
import java.math.BigInteger;
BigInteger square(BigInteger a) {
    return a.multiply(a);
}
int square(int x){
  return x*x;
}
interface F { int get(int a); }
F square = x -> x * x;
import static java.lang.Math.pow;
int square(int a) { return (int) pow(a, 2); }
int square(int a) { return a * a; }
function Square (X : Integer) return Integer is
begin
   return X * X;
end Square;

New implementation...
< >
programming-idioms.org