📄 computepi.java
字号:
import java.rmi.*;
import java.math.*;
public class computePI{
public static void main(String [] args){
if(System.getSecurityManager() == null){
System.setSecurityManager(new RMISercurityManager());
}
try{
String name = "//" + args[0] + "/compute";
compute comp = (compute)Naming.lookup(name);
PI task = new PI(Integer.parseInt(args[1]));
BigDecimal pi = (BigDecimal)(comp.executeTask(task));
System.out.println(pi);
}catch(Exception e){
System.err.println("ComputePI exception:" + e.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -