Forums Register Login

How to convert a String type to a generic class type?

+Pie Number of slices to send: Send
Hi there

I have a String repersentaion of some Object.I want that object convert back into some class type how can I do this?
+Pie Number of slices to send: Send
 

Kishor Joshi wrote:
I have a String repersentaion of some Object.I want that object convert back into some class type how can I do this?



Well, that would depends on (1) what that string representations is? and it also depends on (2) what the object of what class type to do want?

Henry
+Pie Number of slices to send: Send
There's no general, automatic way to do this. You'll have to parse whatever is in the string and initialize a new object with the data that you've parsed from the string.
+Pie Number of slices to send: Send
As it says in our FAQ, you should avoid turning Objects to Strings or vice versa is at all possible.
A teeny tiny vulgar attempt to get you to buy our stuff
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 433 times.
Similar Threads
Typecasting to a dynamic class
Regarding set interface
Generating Public and Private keys.
Comparable conversion to Long
HQL result
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:09:59.