当我使用这段代码时,我得到了错误。错误行是“if”所在的行。为什么?
private ContactListener contactListener()
{
ContactListener contactListener = new ContactListener()
{
@Override
public void beginContact(Contact contact)
{
final Fixture x1 = contact.getFixtureA();
final Fixture x2 = contact.getFixtureB();
if(x1.getBody().getUserData().equals("player"))
{
}
}
@Override
public void endContact(Contact contact)
{
}
};
return contactListener;
}
错误