I would like to create a smalltalk application with a class that has an instance variable that is an array and an instance variable that is the array's size. I would ideally like to initialise these when the object gets created but I have these manually being initialised in a method.
The following is my code:
Object subclass: Student [
| numTests marks |
initialize [
numTests := 0.
marks := Array new: 10.
]
]
student := Student new.
student initialize.
But I get the following error:
Object: Array new: 10 "<0x10b054b80>" error: method is responsibility of a subclass
How can I solve this problem?