Here you can find the source of doubleToChar(double d, char defaultValue)
public static char doubleToChar(double d, char defaultValue)
//package com.java2s; //License from project: LGPL public class Main { public static char doubleToChar(double d, char defaultValue) { if (d >= Character.MIN_VALUE && d <= Character.MAX_VALUE) { return (char) d; }//from w ww .ja v a 2 s .com return defaultValue; } }