⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 magicnumber.java

📁 Java经典例程 从外国一大学计算机教授出版物下载的代码 经典
💻 JAVA
字号:
import java.rmi.*;
import java.rmi.server.*;

/*  A remote object      by J M Bishop  Oct 1997
 *  ===============      Java 1.2 August 2000
 *
 *  These objects can be registered on one machine and
 *  accessed via the Internet and rmi protocol from other
 *  machines.  Compilation is a two-step process:
 *    javac MagicNumber.java
 *    rmic MagicNumber
 *  The latter creates skeletons and stubs for the
 *  remote object. To make it accessible on the network:
 *  In Window 1 type:
 *    rmiregistry
 *  The registry will stay running.
 *  Then activate the server and client parts of the system.
 */

class MagicNumber extends UnicastRemoteObject implements Transferable {

  MagicNumber () throws RemoteException {
  }

  public String getNumber () throws RemoteException {
    return "Your magic number is "+ (int) (Math.random()*100);;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -