casting between classes
807597Jan 30 2005 — edited Jan 31 2005Hi;
I have a method in a class that should pass an object of class type "old"
and I want the modified object of this class to be used,
i.e., the object to be used should be of type "new" in the new.java
where classmethod.java should use (x :old) in the method needed.
here; i need to invoke the method "method()" in the file new.java as follows
method(this);
but in the implementation of "method()" (in classmethod.java) I want to use the object of type "old".
how could i do tha casting?
i did this in classmethod.java
contrsuctormethod( new a){
method ((old) a);
}
but it gives me an error
(inconvertable types)
how could I solve this?