Creating custom blocks I am  building a custom block. The content of module_name/src/Plugin/Block/MyCustomblockName.php is the following.

    namespace Drupal\module_name\Plugin\Block;

    use Drupal\block\BlockBase;
    use Drupal\Core\Session\AccountInterface;

    /**
     * Provides a 'Demo' block.
     *
     * @Block(
     *   id = "demo_block",
     *   admin_label = @Translation("Demo block"),
     * )
     */

    class MyCustomblockName extends BlockBase {

      /**
       * {@inheritdoc}
       */
      public function build() {    
        return array(
          '#markup' =&gt; $this-&gt;t('Hello World!'),
        );
      }

      /**
       * {@inheritdoc}
       */

  public function access(AccountInterface $account) {
    return $account-&gt;hasPermission('access content');
  }  

}


It doesn't display the block at all. What could be the reason?
From the above code replace:

use Drupal\block\BlockBase;


with:

use Drupal\Core\Block\BlockBase;


Then Flush cache and check.
Go to Structure, BlockLayout and click on Place block.