授予以下代码:
classdef highLowGame
methods(Static)
function [wonAmount, noGuesses] = run(gambledAmount)
noGuesses = 'something';
wonAmount = highLowGame.getPayout(gambledAmount, noGuesses); % <---
end
function wonAmount = getPayout(gambledAmount, noGuesses)
wonAmount = 'something';
end
end
end
有没有办法调用同一个类的静态方法(在静态方法中)而不必写类名?像“self.getPayout(...)”这样的东西——以防类结果达到 500 行并且我想重命名它。