As a rule, in any programming language, when a method is called with object instances (or any parameter, for that matter), yes, these objects are created somewhere.
For the most part, you donβt have to worry about where they are when they deal with them within your functions.
Returning to your question, although there may be certain situations when an object was created using unconventional means (depending on the technological stack), you can be sure that most often, if you have a link to the object passed to you in the method that you wrote, then it was created using traditonal methods somewhere in the call stack (or another if you have multiple threads).
In the case of Java, this means that someone called new ... at some point and made it available to the site calling your method in order to pass it as a parameter.
source share