Java Boolean From toBoolean(char c)

Here you can find the source of toBoolean(char c)

Description

convert 'y', or 'n' to boolean

License

Apache License

Parameter

Parameter Description
c a parameter

Declaration

public static Boolean toBoolean(char c) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from  w w  w. j a  v a 2 s.co  m*/
     * convert 'y', or 'n' to boolean
     * @param c
     * @return
     */
    public static Boolean toBoolean(char c) {
        switch (c) {
        case 'y':
            return true;
        case 'n':
            return false;
        default:
            return null;
        }
    }
}

Related

  1. toBoolean(byte[] b)
  2. toBoolean(byte[] byteArray)
  3. toBoolean(byte[] bytes, int offset)
  4. toBoolean(byte[] data, int offset)
  5. toBoolean(byte[] value)
  6. toBoolean(double value)
  7. toBoolean(final Boolean bool)
  8. toBoolean(final Boolean bool)
  9. toBoolean(final byte[] b)