Given is an array of three numeric values and I\'d like to know the middle value of the three.
The question is, what is the fastest way of finding the midd
You can use array, like this:
private static long median(Integer i1, Integer i2, Integer i3) { List<Integer> list = Arrays.asList( i1 == null ? 0 : i1, i2 == null ? 0 : i2, i3 == null ? 0 : i3); Collections.sort(list); return list.get(1); }