math function to find square in java code example Example: math square java int i = 2; int square = Math.pow(i, 2);