3 Answers
New AnswerThe two are often very similar. The main difference you'll usually see is that with Dependency, the instance creation of the other class will take place outside of the encapsulating class and is passed in, usually via the classes constructor. With Composition, the instance of the other class is created within the encapsulating class itself, again usually in the constructor, but may also be done within a method or as a field.
Here, maybe this will explain things better than my attempt. https://www.google.com/amp/s/nirajrules.wordpress.com/2011/07/15/association-vs-dependency-vs-aggregation-vs-composition/amp/
ChaoticDawg but then dependency looks like an aggregation since you do the same thing you described for dependency