How to create an object through a String?

Asked

Viewed 47 times

0

Suppose I have the following object:

public class ItemDePedido {

    private int qtde;
    private double subtotal;
    private Produto produto;
}

In memory this object (already created) is interpreted as :

model.Itemdepedido@40c8f929

My question is the following: Is there any way to convert a String with this value into an Object?

  • Sorry, but I don’t understand why you want to convert the string into object if it is already created. Wouldn’t it just reuse the object? Or you need another instance of that object (clone)?

  • Exactly. I need a clone of this object

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.