File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes A concept of serialization. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "A concept of serialization." Watch "A concept of serialization." New topic

A concept of serialization.

Ishan Pandya
Ranch Hand

Joined: Feb 06, 2012
Posts: 225

Hie Everyone,

There was a question I faced in the interview which was like what is the internal mechanism of JVM for serialization. Like he asked me how the the JVM recognizes internally that if the class implements Serialization then only it is illegible for storing Objects into a file through Serialization process.
Can you please help me out with this question.


Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46375
With interview questions it is not so much a case of what you know as how you answer. What did you say?
Ishan Pandya
Ranch Hand

Joined: Feb 06, 2012
Posts: 225

I said that "as far as i know implementing Serializable is a kind of contract that class is assigned to. like the contract says that class is now identified by the JVM having the capability of Serialization"
So he cross questioned me that (after i said that Serializable is a Marker) how can a marker define a contract. As it does not have any methods into it. After he asked me that "Have you tried to know the internal working?" So like I denied an the question was changed.

What kind of answer should I have given after that ritchie..?
I agree. Here's the link:
subject: A concept of serialization.
It's not a secret anymore!