title: Java how to print all local variables?
body: <p>I have a method and want to examine variables inside it without debugging - is it possible in Java?</p>
  
  <p>I do not want to write tons of code like:  </p>
  
  <pre><code>System.out.println("a: " + a);
  </code></pre>
  
  <p>I want to something like:  </p>
  
  <pre><code>System.out.printLocals();
  </code></pre>
  
  <p>Also it should be great to have something like:  </p>
  
  <pre><code>System.out.printMembersOf(someObjectInstance);
  </code></pre>