📄 gumballmonitortestdrive.java
字号:
package headfirst.proxy.gumball;import java.rmi.*; public class GumballMonitorTestDrive { public static void main(String[] args) { String[] location = {"rmi://santafe.mightygumball.com/gumballmachine", "rmi://boulder.mightygumball.com/gumballmachine", "rmi://seattle.mightygumball.com/gumballmachine"}; GumballMonitor[] monitor = new GumballMonitor[location.length]; for (int i=0;i < location.length; i++) { try { GumballMachineRemote machine = (GumballMachineRemote) Naming.lookup(location[i]); monitor[i] = new GumballMonitor(machine); System.out.println(monitor[i]); } catch (Exception e) { e.printStackTrace(); } } for(int i=0; i < monitor.length; i++) { monitor[i].report(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -