If we add event listener to a button in java like this :
btn.setOnClickListener(new OnClickListener(){
public void onClick(View v)
{
// Do smoething
}
});
this is called we are using inner-class, I have problem in understanding the the concept of inner class
isn’t the inner class declared like this ?
class AOuter{
int a=5;
class BInner{
// do smothing
}
}
The click listener is an anonymous inner class, the other one is simply an inner class. They are both types of nested classes