Java Boolean to Char booleanToChar(boolean[] values)

Here you can find the source of booleanToChar(boolean[] values)

Description

boolean To Char

License

Open Source License

Declaration

public static char[] booleanToChar(boolean[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static char[] booleanToChar(boolean[] values) {
        if (values == null) {
            return null;
        }//from   ww w .ja  va 2 s.c  om

        char[] results = new char[values.length];
        for (int i = 0; i < values.length; i++) {
            results[i] = (values[i] == true ? '1' : '0');
        }
        return results;
    }
}

Related

  1. booleanTochar(final boolean value)
  2. convertBooleanToChar(final boolean value)