java - Serialization return type -
public manager restoremanager(string filename) throws ioexception, classnotfoundexception { // read disk using fileinputstream fileinputstream f_in = new fileinputstream(filename); // read object using objectinputstream objectinputstream obj_in = new objectinputstream(f_in); // read object object obj = obj_in.readobject(); return ????? ; }
i'm "returning manager object based on serialization data found in file", don't know should returning code, can't return object, because return type manager. first time working serialization, i'm unsure of here.
i've tried
return manager(obj); return obj;
***just tried
return (manager) obj;
and working!!
it's
return (manager)obj;
not
return manager(obj);
! – johnchen902 apr 20 @ 5:05
Comments
Post a Comment