使用Java,有没有办法制作一个可以像数组一样使用[]访问器的自定义类?
正常数组
int[] foo = int[5];
foo[4] = 5;
print(foo[4]);
//Output: "5"
Run Code Online (Sandbox Code Playgroud)
自定义类
class Bar {
//Custom class that uses index as a ref
}
Bar foo = new Bar(5);
foo.set(4, 5);
print(foo[4]);
//Output: "5"
Run Code Online (Sandbox Code Playgroud) 当我将我的应用程序的更新发布到Android市场时,它需要几个小时才可用.有时半天为什么会这样?
即使它只是代码或xml中的一个更改,也会发生这种情况.