Is the Abstract keyword needed to make a method abstract?
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
채택된 답변
Steven Lord
2021년 9월 18일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Software Development Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!