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

📄 interestclient.java

📁 这里面有150个从简单到难的java 程序的源代码
💻 JAVA
字号:
package Interest;
import java.util.Properties;
import javax.rmi.PortableRemoteObject; 
import javax.naming.*;
class InterestClient
{
   public static void main(String[] args)
{ 
       try
       {   //获取系统属性,初始化JNDI
 Properties props = new Properties();
// 取得Home对象的引用
          InitialContext jndiContext = new InitialContext(props);
          Object ref  = jndiContext.lookup("interest/Interest");                      InterestHome home = (InterestHome) 
          PortableRemoteObject.narrow (ref, InterestHome.class);
         // 创建EJB对象
          Interest interest = home.create();
	// 计算利息
        System.out.println("利息是:");
         System.out.println(interest.calculateCompoundInterest (1000, 0.10, 2));
       }
       catch(Exception e)
       {
          System.out.println(e.toString());
       }
     }

⌨️ 快捷键说明

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