Spring connecting your repository to a controller - Instantiation of Repository

This is the link of the topic I am looking at. https://www.codecademy.com/courses/learn-spring/lessons/add-a-database-with-jpa/exercises/connect-your-repository-to-a-controller

During this topic, it says that you create a constructor that takes in a repository and assigns it to the class field of your RESTController, in this scenario the PersonRepository inside the PersonController. But where is the PersonRepository or the class that implements the PersonRepository being instantiated? Will Java Spring instantiate it for you and automatically pass it into your constructor?

Essentially, yes. Spring takes care of that. That’s the Dependency Injection that Spring does as part of its Inversion of Control.