What are the "use" statements at the top of Drupal code files?

You may see some snippets like this at the top of a module file:

<?php

/**
 * @file
 * Controls the placement of blocks from all pages.
 */

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;

(From https://github.com/drupal/drupal/blob/8.4.x/core/modules/block_place/block_place.module)

 

Those are namespaces, which map the classes used in the code in the file to the code that provides the class. Read more here: 

https://www.drupal.org/docs/develop/coding-standards/namespaces

Tags
Code