// exj1.java first example simple output integer, string, double // note // makes rest of line a comment import java.io.*; public class exj1 // class name same as file name { public exj1() // constructor same as class name { int i = 7; // declare variable i with initial value 7 char ac = 'a'; // single character String msg = "sample string"; // declare msg with string in quotes float x = 37.95f; // declare floating point x with initial value double y = 127.34e10; // declare double precision with initial value System.out.println("exj1.java running"); // simple print title System.out.println("i="+i); // for decimal System.out.println("ac="+ac); // for character System.out.println("msg="+msg);// for string System.out.println("x="+x); // for simple floating point System.out.println("y="+y); // for double with exponent } // end constructor exj1 optional comment public static void main (String[] args) // "main" required { new exj1(); // construct and execute } } // end class exj1 optional comment