java pi code example Example 1: pi in java use Math.pi to get the double value of pi Example 2: java valeur absolue Math.abs(number)