我很困惑……我有一个直接实现接口(interface)的类:publicclassDeviceimplementsAutocompleteResult{...}这证明我正在寻找正确的变量:Objectmatch=...;log.debug(match.getClass());//Outputs'Device'log.debug(match.getClass().getInterfaces()[0]);//Outputs'AutocompleteResult'然而,当我尝试将类的实例强制转换为接口(interface)时:AutocompleteResultresult=(Autocom
我很困惑……我有一个直接实现接口(interface)的类:publicclassDeviceimplementsAutocompleteResult{...}这证明我正在寻找正确的变量:Objectmatch=...;log.debug(match.getClass());//Outputs'Device'log.debug(match.getClass().getInterfaces()[0]);//Outputs'AutocompleteResult'然而,当我尝试将类的实例强制转换为接口(interface)时:AutocompleteResultresult=(Autocom