Here you can find the source of valueOf(boolean flag)
public static String valueOf(boolean flag)
//package com.java2s; //License from project: Open Source License public class Main { public static String valueOf(char c) { char ac[] = new char[1]; ac[0] = c;//from w w w . ja v a 2 s.c om return new String(ac); } public static String valueOf(double d) { return Double.toString(d); } public static String valueOf(float f) { return Float.toString(f); } public static String valueOf(int i) { char ac[] = new char[11]; int j = ac.length; boolean flag = i < 0; if (!flag) i = -i; for (; i <= -10; i /= 10) ac[--j] = Character.forDigit(-(i % 10), 10); ac[--j] = Character.forDigit(-i, 10); if (flag) ac[--j] = '-'; return new String(ac, j, ac.length - j); } public static String valueOf(long l) { return Long.toString(l, 10); } public static String valueOf(Object obj) { return obj != null ? obj.toString() : ""; } public static String valueOf(boolean flag) { return flag ? "true" : "false"; } public static String valueOf(char ac[]) { return new String(ac); } }