【发布时间】:2014-03-05 21:49:53
【问题描述】:
我有一个类调用 CalcArray,其中包含一个名为 Amounts() 的双精度数组,以及两个 ints、StartPeriod 和 EndPeriod。
用户几乎总是希望与数组中的项目进行交互,而不是 Periods 或对象本身。所以理想情况下,我想:
property AnAmount() as CalcArray 'So the user can talk to the object if they need to
property AnAmount(i as Integer) as Double 'So the user can just get the value directly
这似乎有时有效,但有时无效。这只是一个语法问题吗?或者这样的过载是不可能的?
【问题讨论】:
标签: vb.net