📄 remotegetgrades.java
字号:
package com.wrox.rmi.simple;
import java.rmi.Naming;
import java.rmi.RemoteException;
public class RemoteGetGrades {
static SchoolGrades gServer = null;
public static void main(String args[]) {
try {
gServer = (SchoolGrades) Naming.lookup("//localhost/GradingService");
System.out.println("Average grade is " + gServer.getAverageGrade() + " out of 10");
} catch (Exception e) {
System.out.println("RemoteGetGrades exception: " + e.getMessage());
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -