Since object creation of an interface is not allowed in java. Going through the button event creation code, i passed through this:
View. OnClickListener ocl=new View. OnClickListener ();
As per Android documentation onClickListener is an interface then how can we create its object. Object creation of interface is not allowed but the keyword new clearly does that. How is it possible? Please excuse any mistakes, i am new to Android development.