Код: Выделить всё
String tableName = "MyClass1";
...
switch (tableName) {
case MyClass1.class.getSimpleName():
return 1;
case MyClass2.class.getSimpleName():
return 2;
default:
return Integer.MAX_VALUE;
}
< /code>
Вот онлайн -демонстрация проблемы (openjdk 1.8.0_45Подробнее здесь: https://stackoverflow.com/questions/346 ... -statement