Java how to print all local variables?

后端 未结 6 1996
长情又很酷
长情又很酷 2021-01-12 04:25

I have a method and want to examine variables inside it without debugging - is it possible in Java?

I do not want to write tons of code like:

Syste         


        
6条回答
  •  被撕碎了的回忆
    2021-01-12 04:38

    • Just print them out to the debugger. (Debugging with Eclipse)

    OR

    • Print out to the console: (System.out.println("var"))

    OR

    • User Log4J : http://en.wikipedia.org/wiki/Log4j

提交回复
热议问题