Dashboard > GridGain User Guide > Code Snippet 2
Code Snippet 2
Added by Nikita Ivanov, last edited by Nikita Ivanov on Feb 27, 2007  (view change)
Labels: 
(None)


import org.gridgain.grid.*;

/**
 * Hello world example.
 */
public class HelloWorldExample {
    /**
     * Main entry point.
     *
     * @param args Command line arguments.
     * @throws GridException Thrown in case of any grid error.
     */
    public static void main(String[] args) throws GridException {
        GridFactory.start();

        try {
            sayIt(args.length > 0 ? args[0] : "hello world!");
        }
        finally {
            GridFactory.stop(true);
        }
    }

    /**
     * Prints given <tt>text</tt> to standard output.
     *
     * @param text Text to print.
     */
    public static void sayIt(String text) {
        System.out.println(text);
    }
}

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators