Here you can find the source of Divide(Object in, int val)
public static final void Divide(Object in, int val)
//package com.java2s; //License from project: Open Source License public class Main { public static final void Divide(Object in, int val) { if (in == null) return; if (val == 0) return; if (in instanceof int[]) { int[] inn = (int[]) in; for (int i = 0, s = inn.length; i < s; i++) inn[i] /= val; } else {/*from w w w . jav a 2 s . c o m*/ for (int i = 0, s = ((Object[]) in).length; i < s; i++) Divide(((Object[]) in)[i], val); } } public static final void Divide(int val, Object in) { if (in == null) return; if (val == 0) return; if (in instanceof int[]) { int[] inn = (int[]) in; for (int i = 0, s = inn.length; i < s; i++) inn[i] = (int) (val / inn[i]); } else { for (int i = 0, s = ((Object[]) in).length; i < s; i++) Divide(((Object[]) in)[i], val); } } public static final void Divide(Object in, Object in2) { if (in == null || in2 == null) return; if (in instanceof int[]) { int[] inn = (int[]) in; for (int i = 0, s = inn.length; i < s; i++) inn[i] /= ((int[]) in2)[i]; } else { for (int i = 0, s = ((Object[]) in).length; i < s; i++) Divide(((Object[]) in)[i], ((Object[]) in2)[i]); } } }