【发布时间】:2013-09-04 08:55:17
【问题描述】:
我有 2 节课:
classdef Car
properties
make;
end
methods
function obj=Car(MyMake)
obj.make=MyMake;
end
end
end
和
classdef Engine
properties
power;
end
methods
function obj=Engine(bhp)
obj.power=bhp;
end
end
end
我应该如何在 Car 类中嵌套 Engine 类?
我的想法是按照Honda.Engine.Valve.getDiameter() 的方式做一些事情
在 Python 中,我需要做的就是缩进,我不知道在这里做什么。
【问题讨论】:
标签: matlab class oop nested-class