When obtaining the node types on a given Drupal site in Drupal 7 we use:

$types = node_get_types();

And the content type machine name is available from:

$names = array();
foreach ($types as $type) {
  $names[] = $type->type;
}

In Drupal 8 we use the following:

use Drupal\node\Entity\NodeType;

$types = NodeType::loadMultiple();
$names = array();
foreach ($types as $type) {
  $names[] = $type->id();
}

In Drupal 8 $type->type is protected.  The Node Type class protects all variables but some items are available via functions eg:

isLocked()

isNewRevision() - whether or not a new revision is created each time

displaySubmitted() - whether or not to display author details

getPreviewMode() 

getHelp()

getDescription

Platform

User login