SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
I love Mozart (^o^)
yen hoang wrote:why don't you try to compile this code! The compiler will complain in line "String s=(Fractal)ft.getOb().getMsg(); " that :
_ Type mismatch: cannot convert from Fractal to String ( not in the same hierarchical tree )
_ The method getMsg() is undefined for the type Object
To make compiler happy, you must do st like this String s=((Fractal)ft.getOb()).getMsg();
You should comment at everywhere you can, to track the way it goes. Be sure about the overriding. Good luck!!!
SCJP 6.0
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Regards
Salil Verma