import java.rmi.*;

public class BatClient{
  public BallServer ball;
  public void play(RemoteBall ball) {
    try {
      ball.hit();
    } catch (RemoteException e) {
        System.out.println(e);
    }
  }
  public static void main( String args[]) {
    BatClient bat = new BatClient();
    try {
      System.setSecurityManager( new RMISecurityManager());
      RemoteBall remoteBall = (RemoteBall) 
        Naming.lookup("rmi://localhost/BallServer");
      bat.play(remoteBall);
    } catch(Exception e) {System.out.println(e);}
  }
}

