I have heard a lot that we cannot use Java's interface to instantiate it as a type but when I tried the following code it did not complain. Why?
OnClickListener lis1 = new OnClickListener() {
@Override
public void onClick(View v) {
}
};
As OnClickListener
is a interface, shouldn't it complain?