Java how to print all local variables?

后端 未结 6 1992
长情又很酷
长情又很酷 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:43

    What do you mean by "examining" ? Try a System.out.println(yourvariable), or (yourvariable.toString()) if it's an object. It'll display it in the console.

提交回复
热议问题