title: Does an inner class work as a composition relationship in java?
body: <p>The inner class is always inside the outer class. If we removed the outer class, the inner class would also be destroyed. I'm not concerned about memory release, I am only thinking about the concept. And this is the same concept as composition. IIn this case, the inner class must be the example of a composition relationship of objects in the real world.</p>
  
  <p>In short, how can I relate inner classes to object orientation in real life? By this, I mean a non-technical example; perhaps a metaphor related to animals or video games?</p>
  
  <p>If constructors are a good example of composition, then what is the basic need to involve inner classes in Object Orientation?</p>
  
  <p>Are the examples below accurate?</p>
  
  <hr>
  
  <p>E.g</p>
  
  <p>University is the Outer class.</p>
  
  <p>Faculty is the inner class.</p>
  
  <hr>
  
  <p>I do understand Object Orientation, but I find it difficult to relate the inner class to the real world. Could you give me some pointers?</p>