I parse the finished application under android, the following lines of code cause confusion.
public interface Interface_1 { void interface_1 (); } public interface Interface_2 { void interface_2 (); } public class MyClass_1{ public Interface_1 interface_1; public MyClass_1 (Interface_1 interface_1){ this.interface_1= interface_1; } } public class MyClass_2{ public Interface_2 interface_2; public MyClass_2 (Interface_2 interface_2){ this.interface_1= interface_1; } } public class MainActivity extends AppCompatActivity implements Interface_1 , Interface_2 { new Interface_1 (this); new Interface_2 (this); @Override public void interface_1() { //Реализация метода } @Override public void interface_2() { //Реализация метода } Please explain why this works, because as far as I understand, in this case, this is a link to MainActivity, and when creating objects, you need to pass links to interface_1 and interface_2 objects.