Is the Abstract keyword needed to make a method abstract?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
per isakson
am 17 Sep. 2021
Kommentiert: per isakson
am 18 Sep. 2021
Is this correct Matlab syntax
classdef MyClass
methods
outarg = my_method( this, inarg );
end
end
R2018b accepts it. Assuming this class definition is correct
- is MyClass abstract?
- is the method, my_method, abstract?
meta.class reports that .Abstract==false for both.
1 Kommentar
Akzeptierte Antwort
Steven Lord
am 18 Sep. 2021
That is valid syntax, but not for making my_method an Abstract method. What you've written tells MATLAB that my_method is implemented in a separate file, not in the classdef file for MyClass.
classdef MyClass
methods (Abstract)
outarg = my_method( this, inarg );
end
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Software Development Tools finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!