Serialize Class objects?
1 posts in topic
Flat View  Flat View

Posted By:   Robert_Engels
Posted On:   Sunday, February 3, 2002 11:55 AM

In implementing a remote service, I need to serialize an Array of Class objects. The problem occurs when one of the Class objects is a primitive class.

The following is a valid construct


which returns a Class object of class int

A instance of the above class serializes fine, but during deserialization it throws an exception because, int.class cannot be instantiatiated.

Any clues?

Re: Serialize Class objects?

Posted By:   Bozidar_Dangubic  
Posted On:   Monday, February 4, 2002 07:36 AM

use wrapper classes. that is what they are there for (java.lan.Integer for int, java.lang.Boolean for boolean)...
About | Sitemap | Contact