FileDocCategorySizeDatePackage
HelloWorld.javaAPI DocExample832Sat Nov 25 12:55:54 GMT 2000None

HelloWorld

public class HelloWorld extends Object
A trivial class to show Java Native Interface 1.1 usage from Java.
version
$Id: HelloWorld.java,v 1.4 2000/11/25 17:55:54 ian Exp $

Fields Summary
int
myNumber
Constructors Summary
Methods Summary
public native voiddisplayHelloWorld()

public static voidmain(java.lang.String[] args)

        // used to show argument passing

	// declare native class
	   

	// Application main, call its display method
	     
		System.out.println("HelloWorld starting; args.length="+
			args.length+"...");
		for (int i=0; i<args.length; i++)
			System.out.println("args["+i+"]="+args[i]);
		HelloWorld hw = new HelloWorld();
		hw.displayHelloWorld();		// call the native function
		System.out.println("Back in Java, \"myNumber\" now " + hw.myNumber);