Here you can find the source of toBooleanArray(int[] intArray, int n)
public static boolean[] toBooleanArray(int[] intArray, int n)
//package com.java2s; /* ****************************************************************************** * // w w w . j a va2 s .c o m * This file is part of JMH * * License: * EPL: http://www.eclipse.org/legal/epl-v10.html * LGPL 3.0: http://www.gnu.org/licenses/lgpl-3.0-standalone.html * See the LICENSE file in the project's top-level directory for details. * * **************************************************************************** */ public class Main { public static boolean[] toBooleanArray(int[] intArray, int n) { boolean[] array = new boolean[n]; for (int element : intArray) { array[element] = true; } return array; } }