小编use*_*881的帖子

在界面中,我应该为每个方法使用try-catch或throws?

public interface RMIInterface extends Remote {
    public byte[] geScreen() throws RemoteException;
    public byte[] getProcessList() throws RemoteException;
    public boolean execute(String command) throws RemoteException;
    public boolean messageTo(String msg,String user) throws RemoteException;
    public boolean saveImage(byte[] image,String user) throws RemoteException;
    public byte[][] getimages(String user,String date)throws RemoteException;
}
Run Code Online (Sandbox Code Playgroud)

上面的RMI接口方法抛出RemoteException,如果我将这些方法包含在try中,并且捕获RemoteException就可以了.

java interface

0
推荐指数
1
解决办法
1477
查看次数

标签 统计

interface ×1

java ×1