Here you can find the source of toBoolean(boolean bool)
Parameter | Description |
---|---|
bool | The boolean to convert |
public static Boolean toBoolean(boolean bool)
//package com.java2s; /******************************************************************************* * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://www . j a v a2 s. c o m * IBM Corporation - initial API and implementation *******************************************************************************/ public class Main { /** * Converts a boolean value into Boolean. * @param bool The boolean to convert * @return The corresponding Boolean object (TRUE or FALSE). */ public static Boolean toBoolean(boolean bool) { if (bool) { return Boolean.TRUE; } else { return Boolean.FALSE; } } }