Monday, August 2, 2010

java的警告: The serializable class RadioButtonFrame does not declare a static final serialVersionUID field of type long

給未來的裕翔

最近java練習到GUI部份後

都會出現這個警告

The serializable class RadioButtonFrame does not declare a static final serialVersionUID field of type long

想當初在eclipse時, 直接點一下它就幫我搞定了^^

現在用vim寫我還真不知道怎麼處理

一開始當然是人工忽略該警告

不過最近決定這樣不行, 要了解一下!

於是google到這篇

http://xray2005.javaeye.com/blog/196639

但我不知道他在說啥...

總之, 解決方案是在警告所在位置, 增加以下
private static final long serialVersionUID = 1L;


搞定!

No comments:

Post a Comment