在我的代码中,错误:(47,12)错误:方法声明无效;存在所需的返回类型

时间:2019-05-21 09:27:57

标签: java android

  

错误:(47,12)错误:方法声明无效;返回类型必填

CommunicationHandler类是我的Singleton类,通过它我可以访问vmware中存在的api:

public class CommunicationHandler {

    private CommunicationHandler instance;

    public CommunicationHandler() {
        if (instance == null) {
            instance = new CommunicationHandler();
        }

        return;
    }

    private ApiConnection connection;

    public boolean connect(String ip, String un, String pw) {

        try {
            connection = connect(ip);
            connection.login(un, pw);
        } catch(Exception e) {
            e.toString();
        }

        return true;
    }

    private ApiConnection connect(String ip) {
        return null;
    }

    public Execute(String command) throws MikrotikApiException {
        connection.execute(command);
    }
}

0 个答案:

没有答案