import java.lang.reflect.*; public class PrintPi { public static void main(String[] args) { try { Class math = Class.forName("java.lang.Math"); Field PI = math.getField("PI"); double pi = PI.getDouble(null); System.out.println("PI is " + pi); } catch (Exception e) { System.err.println(e); } } }