Here you can find the source of toBoolean(Object value)
public static final boolean toBoolean(Object value)
//package com.java2s; public class Main { public static final boolean toBoolean(Object value) { if (value instanceof Boolean) return ((Boolean) value).booleanValue(); else if (value == null) return false; else//from w ww . ja va2 s . c om return Boolean.parseBoolean(value.toString()); } public static final String toString(Object value) { if (value == null) return null; return value.toString(); } }