Java tutorial
//package com.java2s; /******************************************************************************* * Manchester Centre for Integrative Systems Biology * University of Manchester * Manchester M1 7ND * United Kingdom * * Copyright (C) 2007 University of Manchester * * This program is released under the Academic Free License ("AFL") v3.0. * (http://www.opensource.org/licenses/academic.php) *******************************************************************************/ import java.util.*; public class Main { /** * * @param array * @return List<Integer> */ public static List<Integer> toList(final int[] array) { final List<Integer> list = new ArrayList<>(); for (final int value : array) { list.add(Integer.valueOf(value)); } return list; } /** * * @param array * @return List<Double> */ public static List<Double> toList(final double[] array) { final List<Double> list = new ArrayList<>(); for (final double value : array) { list.add(Double.valueOf(value)); } return list; } }