[Java] Is there a solution to the cross-reference between the two classes?

Asked 2 years ago, Updated 2 years ago, 23 views

To refer to the methods that two classes need each other

Creating each class object with each other results in an error due to cross-referencing...

Variables do not create class objects and do not interfere with cross-class references.

Obviously, stack overflow errors occur in situations where the methods are referenced to each other.

Is there a way to solve this problem other than creating a separate class that mediates the two classes?

java android

2022-09-21 22:59

1 Answers

I think it's a design issue.

Redesigning is a good way.

The consequences of bad design are later to pay a higher cost.

Please post a problematic example.


2022-09-21 22:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.