954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

why some classes are not serializable

Classes Like Threads,Streams,Runtime and some of awt not serializable.
Please tell me the Reason.
This is asked in my interview.
I said, classes which have native code will not be serializable.
Is it correct?

Please give detail note.

sasidharnet
Newbie Poster
8 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

learn Java.
You obviously lack the knowledge for that job, people giving you the answers so you can send them in as your own in order to get it is doing ourselves a disservice.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
learn Java. You obviously lack the knowledge for that job, people giving you the answers so you can send them in as your own in order to get it is doing ourselves a disservice.


I searched every where I didn't find the answer.

Without taking inputs from others how can we improve our knowledge.

How you learned java your own, you also studied some books or else by berth you know java.

I faced so many questions in that interview but I didn't answer this correctly.

Any way, I just want to know the answer.

If any one knows Please tell why we can not serialize some classes.

sasidharnet
Newbie Poster
8 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

I searched every where I didn't find the answer.

Without taking inputs from others how can we improve our knowledge.

How you learned java your own, you also studied some books or else by berth you know java.

I faced so many questions in that interview but I didn't answer this correctly.

Any way, I just want to know the answer.

If any one knows Please tell why we can not serialize some classes.


Read the actual use of those classes, why they exist and exactly what is serialization used for and you will get your answers.
And obviously you have not been searching everywhere or at least the right places else you would have found it.

stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
 

the right places being any decent book (or probably websites too) on Java that touches on serialisation...
Or common sense.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Yes, just read on serialization itself and you should understand why some of those are not serializable and why it's not appropriate for them to be.
Here's a good place to start: http://www.codeguru.com/java/tij/tij0116.shtml

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

here's something i found (from a forum, as it turns out)
http://www.velocityreviews.com/forums/t150364-which-objects-or-classes-cannot-be-serialized-not-serializable-error.html

and some of you guys like to be dicks. i hope it makes you feel really awesome, because it just makes everyone else feel stupid.

icorey
Newbie Poster
16 posts since Jun 2008
Reputation Points: 4
Solved Threads: 3
 

we don't make people feel stupid. At worst we make them aware of their existing stupidity, which is the first step towards getting rid of that stupidity.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Hi All ,

Classes are not serialzed because they hit efficiency of java directly.
Imagine what would happen if we remotely invoke a class over the network for execution ,definitely it will occupy whole bandwidth and bandwidth will be lost.

An alternative available in java is to add URL of the class so that jvm could find the class.And hence no need to serialized a heavy size class.

csanuj
Newbie Poster
3 posts since Dec 2011
Reputation Points: 7
Solved Threads: 0
 

@csanuj:
1. This thread is from 2008
2. If that was supposed to be an answer to this long-dead thread, it is completely wrong anyway.

JamesCherrill
Posting Genius
Moderator
6,370 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
 

Then what is the right answer dear.

csanuj
Newbie Poster
3 posts since Dec 2011
Reputation Points: 7
Solved Threads: 0
 

If you want a question answered then start your own thread. Hijacking zombie threads is against DaniWeb rules.

JamesCherrill
Posting Genius
Moderator
6,370 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
 

Bull shit.
How you can say it.
You don't have any right answer of your own and you are giving a cross to my answer.
Please make concrete criticism with reason.Otherwise people will be thinking it a time waisting nothing else.

csanuj
Newbie Poster
3 posts since Dec 2011
Reputation Points: 7
Solved Threads: 0
 
Bull shit.

Keep It Pleasant
Do not use offensive or obscene language

Jun 21st, 2008

Keep It Organized
Do not hijack old threads by posting a new question (or answer) as a reply to an old one

check the rules before you try to talk tough

dij_0983
Junior Poster in Training
50 posts since Nov 2011
Reputation Points: 10
Solved Threads: 1
 
You don't have any right answer of your own


and I wouldn't bet on that either :)

stultuske
Posting Sensei
3,135 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You