help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calling overriden method from child class from class folder


From: Julien Bect
Subject: Re: calling overriden method from child class from class folder
Date: Tue, 16 Feb 2016 18:49:43 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Le 16/02/2016 18:38, Carnë Draug a écrit :
The answer depends on where you want to call it from :
>
>a) If you in a method of class B, for instance @B/toto(), the answer is:
>toto(x.A, ...)
>
That is what I did but I find this solution kind of ugly.  You shouldn't
have to keep x.A around to call its methods.  So my question was if there's
a more elegant way to do this.

I don't understand what you mean by "keep x.A around"... ?

Another option would be to implement a method @B/A() which (up)casts an object of class B into an object f class A, and then "toto (A(x), ...)" should work even outside B's methods, I think.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]