如类A:
//先声明A
class A{
private int id;
public int getId();
public void setId(int id){
//
}
}
//声明B
class B{
public void check()
{
A a = new A();
String str = "hello123456789";
if(str.indexOf(a.getId())>0)
{
//----
}
}
}
//编译后;
修改 A中属性id的类型为 string
此时如果不重新编译B;
运行调用会出
java.lang.NoSuchMethodError