This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes serialization with Java refection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "serialization with Java refection" Watch "serialization with Java refection" New topic
Author

serialization with Java refection

Raj chiru
Ranch Hand

Joined: Aug 12, 2008
Posts: 141
Hi...
can I serialize the object with Java Reflection?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18138
    
  39

No. And why would you want to? Isn't it better to use the serialization apis for serialization?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18138
    
  39

Now... unless you mean to use Java reflection to call the Java serialization apis, then sure. But why would you want to do that?

Henry
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19556
    
  16

Technically you can, but you'll be reinventing the wheel. Don't bother, really.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: serialization with Java refection
 
Similar Threads
c++ or Java--your suggestions please
zipping as self extracting exe
class
J2EE
WA #2 ..... word association