Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Advanced-java] Another odd question - how to convert String to literal?


  • From: xwang@xxxxxxxxxxxxxxxxx (Alvin Wang)
  • Subject: [Advanced-java] Another odd question - how to convert String to literal?
  • Date: Fri, 29 Mar 2002 11:36:03 -0500

Hi! Thanks for those helping me with my odd question. Maybe they are naive.
Here is another one.

I serialized an MyClass object into byte[], and then put the byte[] into
database, along with the class name "MyClass" as String. Later on, another
program looks up the databaase, and picks up the byte[] and the class name
"MyClass". It will deserialize byte[] into Object obj. However, I do not
know how to convert obj to be a MyClass object. That means I do not know how
to convert String "MyClass" to java language class name literal of MyClass.
I do not think Reflection will help, because I am not building a new MyClass
object.

Can any guru help me out? Thanks!