What is the Java equivalent of PHP var_dump?

后端 未结 11 616
北荒
北荒 2020-12-12 14:58

PHP has a var_dump() function which outputs the internal contents of an object, showing an object\'s type and content.

For example:

         


        
11条回答
  •  轮回少年
    2020-12-12 15:09

    The apache commons lang package provides such a class which can be used to build up a default toString() method using reflection to get the values of fields. Just have a look at this.

提交回复
热议问题