// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class ArraysCo {
	public abstract static class P {
	}
	public static class CI extends P {
		private int v;
		public CI(int v) {
			this.v = v;
		}
		@Override
		public String toString() {
			return String.format("CI(%d)", v);
		}
	}
	public static class CS extends P {
		private String v;
		public CS(String v) {
			this.v = v;
		}
		@Override
		public String toString() {
			return String.format("CS(%s)", v);
		}
	}
	public static void dump(P[] oa) {
		System.out.printf("Array of %s : ", oa.getClass().componentType().getName());
		for(P o : oa) {
			System.out.printf(" %s", o);
		}
		System.out.println();
	}
	public static void main(String[] args) {
		CI[] cia = { new CI(123), new CI(456) };
		dump(cia);
		CS[] csa = { new CS("ABC"), new CS("DEF") };
		dump(csa);
	}
}
