943,707 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 3366
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Jun 20th, 2008
0

why some classes are not serializable

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sasidharnet is offline Offline
8 posts
since Aug 2007
Jun 21st, 2008
0

Re: why some classes are not serializable

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jun 21st, 2008
0

Re: why some classes are not serializable

Click to Expand / Collapse  Quote originally posted by jwenting ...
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sasidharnet is offline Offline
8 posts
since Aug 2007
Jun 21st, 2008
0

Re: why some classes are not serializable

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.
Featured Poster
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
stephen84s is offline Offline
1,316 posts
since Jul 2007
Jun 21st, 2008
0

Re: why some classes are not serializable

the right places being any decent book (or probably websites too) on Java that touches on serialisation...
Or common sense.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jun 21st, 2008
0

Re: why some classes are not serializable

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
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Ezzaral is offline Offline
6,757 posts
since May 2007
Jun 22nd, 2008
-3

Re: why some classes are not serializable

here's something i found (from a forum, as it turns out)
http://www.velocityreviews.com/forum...ble-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.
Reputation Points: 4
Solved Threads: 3
Newbie Poster
icorey is offline Offline
16 posts
since Jun 2008
Jun 22nd, 2008
0

Re: why some classes are not serializable

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Dec 28th, 2011
0
Re: why some classes are not serializable
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.
Reputation Points: 7
Solved Threads: 0
Newbie Poster
csanuj is offline Offline
3 posts
since Dec 2011
Dec 28th, 2011
0
Re: why some classes are not serializable
@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.
Featured Poster
Reputation Points: 1907
Solved Threads: 950
Posting Expert
JamesCherrill is offline Offline
5,768 posts
since Apr 2008
Message:
Previous Thread in Java Forum Timeline: Java decimal format
Next Thread in Java Forum Timeline: How to create properties file for russian language in swing





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC