作者sorryChen (陈扬和)
看板Programming
标题透过继承来override static variab?
时间Thu Jul 30 09:55:00 2009
假设我原来有个class ex: car.. 有个static variable 叫 num_of_wheel
现在发现我要有很多种car 各有不同的 num_of_wheel.
(每种车wheel的个数是一样的..)
这样透过 继承override num_of_wheel 是一般的做法吗
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 128.125.87.33
1F:→ godfat:都叫 static 了,当然不能 override 220.128.121.85 07/30 10:32