public class Input2 { /* ------------------------------------------------------- Pass information to method with class variable x ------------------------------------------------------- */ public static double x; /* ---------------------------------------------------------- Notice that the method does not have any parameter var ! ---------------------------------------------------------- */ public static double Square( ) { double out; out = x * x; // x contains input information return(out); } public static void main( String[] args ) { double a, b; a = 4.0; x = a; // The value in a is passed using class var x b = Square( ); System.out.println( b) ; } }