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

📄 factorialimpl.java

📁 书籍《JAVA面向对象程序设计》书籍的课后源代码。相信对很多人都有帮助
💻 JAVA
字号:
///////    FactorialImpl.java    ///////
package myrmi.demo;

import java.rmi.*;
import java.rmi.activation.*;

public class FactorialImpl extends Activatable
    implements Factorial
{ 
    public FactorialImpl(ActivationID id, MarshalledObject data)
                   throws RemoteException
    {
        super(id, 0);
    }

    public int factorial(int n)
            throws RemoteException
    {
        if ( n < 0 )
            throw( new RemoteException(
                     "Arg to factorial cannot be negative."));
        return ( n == 0 ) ? 1
               : n*factorial(n-1);
    }
}

⌨️ 快捷键说明

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