B
Bryan
Hello all,
Say I have the following two objects:
public class ObjectA {
public void load() { }
}
public class ObjectB extends ObjectA { }
ObjectB is a rarely used extension of ObjectA, but does need to be
created every once in a while. What I want to be able to do is load
data into ObjectA, and if certain data criteria is met I want ObjectA
to now be of type ObjectB instead. Is there any way to "perminately
cast" the type of an object? For instance, is there a way to make an
object that was created as ObjectA now be as if it were created as
ObjectB?
Thanks in advance!
Say I have the following two objects:
public class ObjectA {
public void load() { }
}
public class ObjectB extends ObjectA { }
ObjectB is a rarely used extension of ObjectA, but does need to be
created every once in a while. What I want to be able to do is load
data into ObjectA, and if certain data criteria is met I want ObjectA
to now be of type ObjectB instead. Is there any way to "perminately
cast" the type of an object? For instance, is there a way to make an
object that was created as ObjectA now be as if it were created as
ObjectB?
Thanks in advance!