Your OWRS Class should implement java.util.Serializable interface
> import java.util.Date;
> public class OWRS {
[quoted text clipped - 29 lines]
>
> D:\Example\javaux\IO>
Lew - 22 Oct 2006 19:48 GMT
>> import java.util.Date;
>> public class OWRS {
[quoted text clipped - 11 lines]
>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
>> at OWS.main(OWS.java:25)
> Your OWRS Class should implement java.util.Serializable interface
There are also methods to define, UIDs to assign - merely implementing
Serializable is not sufficient.
One should also reconsider making instance variables public. Furthermore, the
convention for non-constant variables is to name them with an initial
lower-case letter.
> public String S1;
to
private String s1;
with appropriate accessor methods.
- Lew
moonhk - 23 Oct 2006 16:48 GMT
Thank Tested, it Works.
import java.util.Date;
public class OWRS implements java.io.Serializable {
public String s1;
public Date currDate ;
}
> Your OWRS Class should implement java.util.Serializable interface
>
[quoted text clipped - 31 lines]
> >
> > D:\Example\javaux\IO>
Lew - 24 Oct 2006 12:52 GMT
(post re-ordered to eliminate top posting)
>>> untime error
>>> D:\Example\javaux\IO>java OWS
>>> Write Object to file theTime
>>> Exception in thread "main" java.io.NotSerializableException: OWRS
>> Your OWRS Class should implement java.util.Serializable interface
> Thank Tested, it Works.
>
[quoted text clipped - 4 lines]
>
> }
Until you change the implementation of OWRS.
- Lew