import java.rmi.*;
/**
* this class is the client for rmiexampleserver
* @author renga
**/
public class rmiclient {
/**
* main method
* @param args command-line arguments
**/
public static void main( string[] args ) {
try {
// set the security manager
system.setsecuritymanager( new rmisecuritymanager() );
// look up rmiexampleserver in the rmi registry
rmiexample server = (rmiexample) naming.lookup( "rmiexample" );
// invoke the method
system.out.println( server.sayhello() );
} catch( exception e ) {
e.printstacktrace();
}
}
}
闽公网安备 35060202000074号