1
Я получаю эту ошибку:Сравнение типов с помощью отражения
incomparable types: Class and String where CAP#1 is a fresh type-variable: CAP#1 extends Object from capture of ?
Object object;
Field[] fields = object.getClass().getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
if (fields[i].getType() == String) { //On this line the compiler error is displayed
//Can't get in here
}
}
Я думал, что я сравнивал два одинаковых классов в этом if
заявление?