Converting back from toString to Object

前端 未结 7 1732
谎友^
谎友^ 2020-12-11 21:23

Is there any way to convert from toString back to the object in Java?

For example:

Map myMap = new HashMap

        
7条回答
  •  悲&欢浪女
    2020-12-11 22:04

    A string is also an object. And no it's not possible to get the original object from its string representation (via toString()). You can simply get this by thinking about how much information is (or can be) stored within an object but how short the string representation is.

提交回复
热议问题