?? interestclient.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 + -