What is the Java equivalent of PHP var_dump?
<p><strong>PHP has a <a href="http://php.net/var_dump">var_dump()</a> function which outputs the internal contents of an object, showing an object's type and content.</strong></p>

<p>For example:</p>

<pre><code>class Person {
  private $firstName;
  private $lastName;

  public function __construct($firstName, $lastName) {
    $this-&gt;firstName = $firstName;
    $this-&gt;lastName = $lastName;
  }
}

$person = new Person('Jon', 'Smith');
var_dump($person);
</code></pre>

<p>will output:</p>

<pre><code>object(Person)#1 (2) {
  ["firstName:private"]=&gt;
  string(3) "Jon"
  ["lastName:private"]=&gt;
  string(5) "Smith"
}
</code></pre>

<p><strong>What is the equivalent in Java that will do the same?</strong></p>
