Here you can find the source of printArray(boolean[] array)
public static String printArray(boolean[] array)
//package com.java2s; public class Main { public static String printArray(boolean[] array) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < array.length; i++) { if (i > 0) { sb.append(" "); }// w w w. j a v a 2 s. com sb.append(array[i] ? "1" : "0"); } return sb.reverse().toString(); } }