Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8332

Re: doubts in narrow casting

$
0
0
swadhin ,

what u have explained i know it already.

the problem is calling method m4 of subclass from super class instance (object) after narrow casting which is only defined in subclass  not super class.

i should have commented that statement

create object o_super in my code while posting que . my mistake.


but what i wanna know is:

i want to call m4 method of sub class using super class instance.

see this...

" below statement throw a syntax error becoz its not possible to access those

*method which are not defined in super class

*call method o_super->m4.  "throws syntax error.


but when i change this to m4 in brackets:

call method o_super->('m4'). "works fine WHY!!!!!! (atleast no syntax error)


but the prog dumps.

another thing if i want to make prog not to dump how to change it into dynamic type from static type.

how to do that.


i hope u now understand what i want to know.





Viewing all articles
Browse latest Browse all 8332

Trending Articles