import java.net.MalformedURLException; import java.rmi.Naming; import java.rmi.NotBoundException; import java.rmi.RemoteException; import javax.swing.JOptionPane; public class ClientOperation { private static RMIInterface look_up; public static void main(String[] args) throws RemoteException { try{ look_up = (RMIInterface) Naming.lookup("//localhost/MyServer"); String txtNum = JOptionPane.showInputDialog("Enter the number"); int number=Integer. parseInt(txtNum); String txtNum1 = JOptionPane.showInputDialog("Enter the power"); int pow=Integer. parseInt(txtNum1); String response = look_up.power(number, pow); JOptionPane.showMessageDialog(null, response); } catch(Exception e){ System.err.println("Server exception: " + e.toString()); e.printStackTrace(); } } }