boolean.html
来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 618 行 · 第 1/2 页
HTML
618 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_03) on Wed Nov 02 09:48:08 CST 2005 --><META http-equiv="Content-Type" content="text/html; charset=gb2312"><TITLE>Boolean (Java 2 Platform SE 5.0)</TITLE><META NAME="keywords" CONTENT="java.lang.Boolean class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="Boolean (Java 2 Platform SE 5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="跳过导航链接"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Boolean.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Standard Ed. 5.0</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="AssertionError.html" title="java.lang 中的类"><B>上一个类</B></A> <A HREF="Byte.html" title="java.lang 中的类"><B>下一个类</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html@java_2Flang_2FBoolean.html" target="_top"><B>框架</B></A> <A HREF="Boolean.html" target="_top"><B>无框架</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>所有类</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 摘要: 嵌套 | <A HREF="#field_summary">字段</A> | <A HREF="#constructor_summary">构造方法</A> | <A HREF="#method_summary">方法</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">详细信息: <A HREF="#field_detail">字段</A> | <A HREF="#constructor_detail">构造方法</A> | <A HREF="#method_detail">方法</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.lang</FONT><BR>类 Boolean</H2><PRE><A HREF="Object.html" title="java.lang 中的类">java.lang.Object</A> <IMG SRC="../../resources/inherit.gif" ALT="继承者 "><B>java.lang.Boolean</B></PRE><DL><DT><B>所有已实现的接口:</B> <DD>java.io.Serializable, <A HREF="Comparable.html" title="java.lang 中的接口">Comparable</A><<A HREF="Boolean.html" title="java.lang 中的类">Boolean</A>></DD></DL><HR><DL><DT><PRE>public final class <B>Boolean</B><DT>extends <A HREF="Object.html" title="java.lang 中的类">Object</A><DT>implements java.io.Serializable, <A HREF="Comparable.html" title="java.lang 中的接口">Comparable</A><<A HREF="Boolean.html" title="java.lang 中的类">Boolean</A>></DL></PRE><P>Boolean 类将基本类型为 <code>boolean</code> 的值包装在一个对象中。一个 <code>Boolean</code> 类型的对象只包含一个类型为 <code>boolean</code> 的字段。 <p>此外,此类还为 <code>boolean</code> 和 <code>String</code> 的相互转换提供了许多方法,并提供了处理 <code>boolean</code> 时非常有用的其他一些常量和方法。<P><P><DL><DT><B>从以下版本开始:</B></DT> <DD>JDK1.0</DD><DT><B>另请参见:</B><DD><A HREF="../../serialized-form.html#java.lang.Boolean">序列化表格</A></DL><HR><P><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>字段摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="Boolean.html" title="java.lang 中的类">Boolean</A></CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#FALSE">FALSE</A></B></CODE><BR> 对应基值 <code>false</code> 的 <code>Boolean</code> 对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="Boolean.html" title="java.lang 中的类">Boolean</A></CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#TRUE">TRUE</A></B></CODE><BR> 对应基值 <code>true</code> 的 <code>Boolean</code> 对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="Class.html" title="java.lang 中的类">Class</A><<A HREF="Boolean.html" title="java.lang 中的类">Boolean</A>></CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#TYPE">TYPE</A></B></CODE><BR> 表示基本类型 boolean 的 Class 对象。</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>构造方法摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="Boolean.html#Boolean(boolean)">Boolean</A></B>(boolean value)</CODE><BR> 分配一个表示 <code>value</code> 参数的 <code>Boolean</code> 对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="Boolean.html#Boolean(java.lang.String)">Boolean</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A> s)</CODE><BR> 如果 String 参数不为 <code>null</code> 且在忽略大小写时等于 <code>"true"</code>,则分配一个表示 <code>true</code> 值的 <code>Boolean</code> 对象。</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>方法摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#booleanValue()">booleanValue</A></B>()</CODE><BR> 将此 <tt>Boolean</tt> 对象的值作为基本布尔值返回。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#compareTo(java.lang.Boolean)">compareTo</A></B>(<A HREF="Boolean.html" title="java.lang 中的类">Boolean</A> b)</CODE><BR> 将此 <tt>Boolean</tt> 实例与其他实例进行比较。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#equals(java.lang.Object)">equals</A></B>(<A HREF="Object.html" title="java.lang 中的类">Object</A> obj)</CODE><BR> 当且仅当参数不是 <code>null</code>,而是一个与此对象一样,都表示同一个 <code>Boolean</code> 值的 <code>boolean</code> 对象时,才返回 <code>true</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#getBoolean(java.lang.String)">getBoolean</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A> name)</CODE><BR> 当且仅当以参数命名的系统属性存在,且等于 <code>"true"</code> 字符串时,才返回 <code>true</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#hashCode()">hashCode</A></B>()</CODE><BR> 返回该 <tt>Boolean</tt> 对象的哈希代码。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#parseBoolean(java.lang.String)">parseBoolean</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A> s)</CODE><BR> 将字符串参数分析为 boolean 值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="String.html" title="java.lang 中的类">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#toString()">toString</A></B>()</CODE><BR> 返回表示该布尔值的 <tt>String</tt> 对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="String.html" title="java.lang 中的类">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#toString(boolean)">toString</A></B>(boolean b)</CODE><BR> 返回一个表示指定布尔值的 <tt>String</tt> 对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="Boolean.html" title="java.lang 中的类">Boolean</A></CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#valueOf(boolean)">valueOf</A></B>(boolean b)</CODE><BR> 返回一个表示指定 <tt>boolean</tt> 值的 <tt>Boolean</tt> 实例。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="Boolean.html" title="java.lang 中的类">Boolean</A></CODE></FONT></TD><TD><CODE><B><A HREF="Boolean.html#valueOf(java.lang.String)">valueOf</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A> s)</CODE><BR> 返回一个用指定的 String 表示值的 <code>Boolean</code> 值。</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从类 java.lang.<A HREF="Object.html" title="java.lang 中的类">Object</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="Object.html#clone()">clone</A>, <A HREF="Object.html#finalize()">finalize</A>, <A HREF="Object.html#getClass()">getClass</A>, <A HREF="Object.html#notify()">notify</A>, <A HREF="Object.html#notifyAll()">notifyAll</A>, <A HREF="Object.html#wait()">wait</A>, <A HREF="Object.html#wait(long)">wait</A>, <A HREF="Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>字段详细信息</B></FONT></TH></TR></TABLE><A NAME="TRUE"><!-- --></A><H3>TRUE</H3><PRE>public static final <A HREF="Boolean.html" title="java.lang 中的类">Boolean</A> <B>TRUE</B></PRE><DL><DD>对应基值 <code>true</code> 的 <code>Boolean</code> 对象。<P><DL></DL></DL><HR><A NAME="FALSE"><!-- --></A><H3>FALSE</H3><PRE>public static final <A HREF="Boolean.html" title="java.lang 中的类">Boolean</A> <B>FALSE</B></PRE><DL><DD>对应基值 <code>false</code> 的 <code>Boolean</code> 对象。<P><DL></DL></DL><HR><A NAME="TYPE"><!-- --></A><H3>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?