When does one object depend on another?
If class A creates or uses object B, then A depends on B – it needs it to work with, to fulfill maybe some task.
But B depends also on A, its created or used by it.
So is dependency in java circular?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your definition is circular however Java’s references only go one way.
Dependencies only go from Object that has a need to Objects which provided that need. You can have circular dependencies. You can’t talk about a need to be needed for Objects. I think that only applies to people (and possibly pets). 😉