i'd like to have a constructor that loads an object from disk and returns
it... kinda like:
class MyClass
{
MyClass(File f)
{
ObjectInputStream s = new ObjectInputStream(new
FileInputStream(f));
this = (MyClass)s.readObject();
}
}
now i know you cannot do this because this in the constructor is a final
variable...
is there trick that i don't know of that can do this?
p.s., before i get the typical responses... i already am using a static
factory method to accomplish the same thing... i'm just looking to make it
even easier to use my classes.
thanks for any help,
murat
--
Murat Tasan
mx**@po.cwru.edu
ta***@eecs.cwru.edu
mu*********@cwru.edu
http://genomics.cwru.edu