Redian新闻
>
writeObject()的时候出现NotSerializableException是怎么回事?
avatar
writeObject()的时候出现NotSerializableException是怎么回事?# Java - 爪哇娇娃
c*n
1
不是任何class的instance都能用这个writeObject()写到流里面去么?
看了一下那个Serializable的interface, 没太明白这里是为什么会有Exception.
谁能给点拨一下么?
avatar
a*l
2
true

concrete

【在 c*********n 的大作中提到】
: 不是任何class的instance都能用这个writeObject()写到流里面去么?
: 看了一下那个Serializable的interface, 没太明白这里是为什么会有Exception.
: 谁能给点拨一下么?

avatar
c*n
3
So what I need to do is just to add "implements Serializable" after the name
of the class?
Sounds a little wierd - implementing some interface without writing any
concrete
code for the implementing...
Thanks.

your object need to implement Serializable
it's just an empty interface, but required for serialization

【在 a**l 的大作中提到】
: true
:
: concrete

avatar
p*p
4
Yes, but there are some warning, to implement some Serializ ID...
avatar
a*l
5
true

concrete

【在 c*********n 的大作中提到】
: So what I need to do is just to add "implements Serializable" after the name
: of the class?
: Sounds a little wierd - implementing some interface without writing any
: concrete
: code for the implementing...
: Thanks.
:
: your object need to implement Serializable
: it's just an empty interface, but required for serialization

avatar
p*p
6
Yes, but there are some warning, to implement some Serializ ID...
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。