我有一個可以製作汽車對象的類。它有兩個實例變量:Make和Color。我有調用工作空間內的本方法的一個問題(下面指出)在Smalltalk中調用構造函數方法
類方法-Constructor
make: aMake color: aColor
"Creates a new car object, sets its instance variables by the arguments"
|car|
car := self new.
car setMake: aMake setColor: aColor. "accessor method below"
^car
存取方法
setMake: make setColor: color
"sets the instance variables"
Make := make.
Color := color.
工作區(呼叫碼)
|car|
car := Car make: 'toyota' color: 'red'
當我調用這一行時,我得到'消息未明白'。這裏有什麼問題?
我的問題是與IDE – BDillan 2014-12-10 01:33:21