
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.63 KB | hits: 11 | expires: Never
Append to 2-dimensional array
String[][] headings = new String[][] { {
"three",
"three",
"three"
} };
String[][] headings = new String[][] { {
"three",
"three",
"three"
}, {} }; // note placeholder for to-be-added triplet.
String val = condition ? "one": "two";
headings[1] = new String[] {val, val, val};
ArrayList<String[]> headings = new ArrayList<String[]>();
headings.add(new String[] { "three", "three", "three" });
if(/* condition */)
headings.add(new String[] { "two", "two", "two" });
else
headings.add(new String[] { "one", "one", "one" });