...
Compliant Solution (Index Getter)
This noncompliant code example compliant solution makes the array private
, and provides a public
methods to get individual items and array size
Code Block | ||
---|---|---|
| ||
private static final String[] items = {/* ... */}; public static final String getItem(int index) { return items[index]; } public static final int getItemCount() { return items.length; } |
...