public class Output2 { /* ------------------------------------------------------- Pass information out of method with CLASS variable ------------------------------------------------------- */ public static double out; public static void Square( double x ) { out = x * x; // Store the result in CLASS var "out" } public static void main( String[] args ) { double a, b; a = 4.0; Square( a ); // The return value is saved in CLASS var out b = out; // Get the result ! System.out.println( b) ; } }