<!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.4.2-rc) on Fri Jun 13 00:14:17 PDT 2003 -->
<TITLE>
Boolean (Java 2 Platform SE v1.4.2)
</TITLE>
<META NAME="keywords" CONTENT="java.lang.Boolean class">
<META NAME="keywords" CONTENT="TRUE">
<META NAME="keywords" CONTENT="FALSE">
<META NAME="keywords" CONTENT="TYPE">
<META NAME="keywords" CONTENT="booleanValue()">
<META NAME="keywords" CONTENT="valueOf()">
<META NAME="keywords" CONTENT="toString()">
<META NAME="keywords" CONTENT="hashCode()">
<META NAME="keywords" CONTENT="equals()">
<META NAME="keywords" CONTENT="getBoolean()">
<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 v1.4.2)";
}
</SCRIPT>
<style type="text/css">
<!--
.style1 {font-family: "??_GB2312", "??_GB2312", "??"}
-->
</style>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 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>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Boolean.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</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>Std. Ed. v1.4.2</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../java/lang/Byte.html" title="class in java.lang"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Boolean.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</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>
Class Boolean</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>java.lang.Boolean</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/io/Serializable.html" title="interface in java.io">Serializable</A></DD>
</DL>
<HR>
<DL>
<DT>public final class <B>Boolean</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A><DT>implements <A HREF="../../java/io/Serializable.html" title="interface in java.io">Serializable</A></DL>
<P>
The Boolean class wraps a value of the primitive type
<code>boolean</code> in an object. An object of type
<code>Boolean</code> contains a single field whose type is
<code>boolean</code>.
Boolean类以对象的形式对简单类型boolean进行包装,一个Boolean类型的对象包含一个类型为boolean的域。
<p>
In addition, this class provides many methods for
converting a <code>boolean</code> to a <code>String</code> and a
<code>String</code> to a <code>boolean</code>, as well as other
constants and methods useful when dealing with a
<code>boolean</code>.
而且,该类提供了很多将boolean转化成String或者String转化成boolean的方法,在处理boolean时其他的一些常量和方法同样有用。<span class="style1"></span>
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>JDK1.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../serialized-form.html#java.lang.Boolean">Serialized Form</A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../java/lang/Boolean.html" title="class in java.lang">Boolean</A></CODE></FONT></TD>
<TD><p><CODE><B><A HREF="../../java/lang/Boolean.html#FALSE">FALSE</A></B></CODE>
<BR>
The <code>Boolean</code> object corresponding to the primitive
value <code>false</code>.相当于简单类型false的Boolean对象。</p> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../java/lang/Boolean.html" title="class in java.lang">Boolean</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Boolean.html#TRUE">TRUE</A></B></CODE>
<BR>
The <code>Boolean</code> object corresponding to the primitive
value <code>true</code>.相当于简单类型true的Boolean对象。<span class="style1"></span>。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../java/lang/Class.html" title="class in java.lang">Class</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Boolean.html#TYPE">TYPE</A></B></CODE>
<BR>
The Class object representing the primitive type boolean.表示简单类型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">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Boolean.html#Boolean(boolean)">Boolean</A></B>(boolean value)</CODE>
<BR>
Allocates a <code>Boolean</code> object representing the
<code>value</code> argument.创建表示value参数值的Boolean对象。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Boolean.html#Boolean(java.lang.String)">Boolean</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> s)</CODE>
<BR>
Allocates a <code>Boolean</code> object representing the value
<code>true</code> if the string argument is not <code>null</code>
and is equal, ignoring case, to the string <code>"true"</code>.如果string参数不为null(忽略大小写)且等于字符串true,则创建表示true值的Boolean对象。</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">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></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="../../java/lang/Boolean.html#booleanValue()">booleanValue</A></B>()</CODE>
<BR>
Returns the value of this <tt>Boolean</tt> object as a boolean
primitive.以boolean简单类型返回Boolean对象的值。</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="../../java/lang/Boolean.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A> obj)</CODE>
<BR>
Returns <code>true</code> if and only if the argument is not
<code>null</code> and is a <code>Boolean </code>object that
represents the same <code>boolean</code> value as this object.
只有当该参数是个不为null的Boolean对象,和自身对象表示的boolean值相等时,返回true。</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="../../java/lang/Boolean.html#getBoolean(java.lang.String)">getBoolean</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> name)</CODE>
<BR>
Returns <code>true</code> if and only if the system property
named by the argument exists and is equal to the string
<code>"true"</code>.只有当以参数命名的系统属性存在且等于字符串true时,返回true。</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="../../java/lang/Boolean.html#hashCode()">hashCode</A></B>()</CODE>
<BR>
Returns a hash code for this <tt>Boolean</tt> object.返回该Boolean对象的hash码。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Boolean.html#toString()">toString</A></B>()</CODE>
<BR>
Returns a <tt>String</tt> object representing this Boolean's
value.返回该Boolean值的字符串形式。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Boolean.html#toString(boolean)">toString</A></B>(boolean b)</CODE>
<BR>
Returns a <tt>String</tt> object representing the specified
boolean.返回指定boolean值的字符串形式。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../java/lang/Boolean.html" title="class in java.lang">Boolean</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Boolean.html#valueOf(boolean)">valueOf</A></B>(boolean b)</CODE>
<BR>
Returns a <tt>Boolean</tt> instance representing the specified
<tt>boolean</tt> value.返回指定boolean值的Boolean形式。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../java/lang/Boolean.html" title="class in java.lang">Boolean</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Boolean.html#valueOf(java.lang.String)">valueOf</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> s)</CODE>
<BR>
Returns a <code>Boolean</code> with a value represented by the
specified String.返回指定字符串的Boolean形式。</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">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/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">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="TRUE"><!-- --></A><H3>
TRUE</H3>
<PRE>
public static final <A HREF="../../java/lang/Boolean.html" title="class in java.lang">Boolean</A> <B>TRUE</B></PRE>
<DL>
<DD>The <code>Boolean</code> object corresponding to the primitive
value <code>true</code>.相当于简单类型true的Boolean对象。
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="FALSE"><!-- --></A><H3>
FALSE</H3>
<PRE>
public static final <A HREF="../../java/lang/Boolean.html" title="class in java.lang">Boolean</A> <B>FALSE</B></PRE>
<DL>
<DD>The <code>Boolean</code> object corresponding to the primitive
value <code>false</code>.相当于简单类型false的Boolean对象。
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="TYPE"><!-- --></A><H3>
TYPE</H3>
<PRE>
public static final <A HREF="../../java/lang/Class.html" title="class in java.lang">Class</A> <B>TYPE</B></PRE>
<DL>
<DD>The Class object representing the primitive type boolean.表示简单类型boolean的Class对象。
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>JDK1.1</DD>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Boolean(boolean)"><!-- --></A><H3>
Boolean</H3>
<PRE>
public <B>Boolean</B>(boolean value)</PRE>
<DL>
<DD>Allocates a <code>Boolean</code> object representing the
<code>value</code> argument. 创建表示value参数值的Boolean对象。
<p><b>Note: It is rarely appropriate to use this constructor.
Unless a <i>new</i> instance is required, the static factory
<A HREF="../../java/lang/Boolean.html#valueOf(boolean)"><CODE>valueOf(boolean)</CODE></A> is generally a better choice. It is
likely to yield significantly better space and time performance.</b>
使用该构造函数一般是不恰当的,除非需要new一个实例,通常情况下使用静态工厂方法valueOf(boolean)更好,那可能获取更好的空间和时间性能。
<P>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - the value of the <code>Boolean</code>.Boolean的值。</DL>
<HR>
<A NAME="Boolean(java.lang.String)"><!-- --></A><H3>
Boolean</H3>
<PRE>
public <B>Boolean</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> s)</PRE>
<DL>
<DD>Allocates a <code>Boolean</code> object representing the value
<code>true</code> if the string argument is not <code>null</code>
and is equal, ignoring case, to the string <code>"true"</code>.
Otherwise, allocate a <code>Boolean</code> object representing the
value <code>false</code>. Examples:如果string参数不为null(忽略大小写)且等于字符串true,则创建表示true值的Boolean对象。
否则创建表示false值的Boolean对象。<p>
<tt>new Boolean("True")</tt> produces a <tt>Boolean</tt> object
that represents <tt>true</tt>.生成表示true的Boolean对象。<br>
<tt>new Boolean("yes")</tt> produces a <tt>Boolean</tt> object
that represents <tt>false</tt>.生成表示false的Boolean对象。
<P>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - the string to be converted to a <code>Boolean</code>.用来转换成Boolean的字符串。</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="booleanValue()"><!-- --></A><H3>
booleanValue</H3>
<PRE>
public boolean <B>booleanValue</B>()</PRE>
<DL>
<DD>Returns the value of this <tt>Boolean</tt> object as a boolean
primitive.以boolean简单类型返回Boolean对象的值。
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the primitive <code>boolean</code> value of this object.该对象的boolean值。</DL>
</DD>
</DL>
<HR>
<A NAME="valueOf(boolean)"><!-- --></A><H3>
valueOf</H3>
<PRE>
public static <A HREF="../../java/lang/Boolean.html" title="class in java.lang">Boolean</A> <B>valueOf</B>(boolean b)</PRE>
<DL>
<DD>Returns a <tt>Boolean</tt> instance representing the specified
<tt>boolean</tt> value. If the specified <tt>boolean</tt> value
is <tt>true</tt>, this method returns <tt>Boolean.TRUE</tt>;
if it is <tt>false</tt>, this method returns <tt>Boolean.FALSE</tt>.
If a new <tt>Boolean</tt> instance is not required, this method
should generally be used in preference to the constructor
<A HREF="../../java/lang/Boolean.html#Boolean(boolean)"><CODE>Boolean(boolean)</CODE></A>, as this method is likely to to yield
significantly better space and time performance.
返回指定boolean值的Boolean形式。如果指定boolean值为true,该方法返回Boolean.TRUE;如果为false,返回Boolean.FALSE。
如果不需要生成一个新的Boolean实例,优先使用该方法,而不是构造函数Boolean(boolean),该方法可能会带来更好的空间和时间性能。
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - a boolean value.boolean值。
<DT><B>Returns:</B><DD>a <tt>Boolean</tt> instance representing <tt>b</tt>.表示b的Boolean实例。<DT><B>Since:</B></DT>
<DD>1.4</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="valueOf(java.lang.String)"><!-- --></A><H3>
valueOf</H3>
<PRE>
public static <A HREF="../../java/lang/Boolean.html" title="class in java.lang">Boolean</A> <B>valueOf</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> s)</PRE>
<DL>
<DD>Returns a <code>Boolean</code> with a value represented by the
specified String. The <code>Boolean</code> returned represents the
value <code>true</code> if the string argument is not <code>null</code>
and is equal, ignoring case, to the string <code>"true"</code>.
返回指定字符串的Boolean形式。如果该字符串参数不为空(忽略大小写)且等于字符串true,返回表示true的Boolean对象。<p>
Example: <tt>Boolean.valueOf("True")</tt> returns <tt>true</tt>.<br>
Example: <tt>Boolean.valueOf("yes")</tt> returns <tt>false</tt>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - a string.字符串。
<DT><B>Returns:</B><DD>the <code>Boolean</code> value represented by the string.字符串的Boolean值。</DL>
</DD>
</DL>
<HR>
<A NAME="toString(boolean)"><!-- --></A><H3>
toString</H3>
<PRE>
public static <A HREF="../../java/lang/String.html" title="class in java.lang">String</A> <B>toString</B>(boolean b)</PRE>
<DL>
<DD>Returns a <tt>String</tt> object representing the specified
boolean. If the specified boolean is <code>true</code>, then
the string <tt>"true"</tt> will be returned, otherwise the
string <tt>"false"</tt> will be returned.
返回指定boolean值的字符串形式。如果指定的boolean值为true,返回字符串true,否则返回字符串false。
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the boolean to be converted被转换的boolean值
<DT><B>Returns:</B><DD>the string representation of the specified <code>boolean</code>指定boolean的字符串形式<DT><B>Since:</B></DT>
<DD>1.4</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="../../java/lang/String.html" title="class in java.lang">String</A> <B>toString</B>()</PRE>
<DL>
<DD>Returns a <tt>String</tt> object representing this Boolean's
value. If this object represents the value <code>true</code>,
a string equal to <code>"true"</code> is returned. Otherwise, a
string equal to <code>"false"</code> is returned.
返回该Boolean值的字符串形式。如果该对象表示true值,返回字符串true,否则返回字符串false。
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a string representation of this object.表示该对象的字符串形式。</DL>
</DD>
</DL>
<HR>
<A NAME="hashCode()"><!-- --></A><H3>
hashCode</H3>
<PRE>
public int <B>hashCode</B>()</PRE>
<DL>
<DD>Returns a hash code for this <tt>Boolean</tt> object.返回该Boolean对象的hash码。
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the integer <tt>1231</tt> if this object represents
<tt>true</tt>; returns the integer <tt>1237</tt> if this
object represents <tt>false</tt>.
如果该对象表示true,返回整数1231,如果该对象表示false,返回1237。<DT><B>See Also:</B><DD><A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>Object.equals(java.lang.Object)</CODE></A>,
<A HREF="../../java/util/Hashtable.html" title="class in java.util"><CODE>Hashtable</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
equals</H3>
<PRE>
public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A> obj)</PRE>
<DL>
<DD>Returns <code>true</code> if and only if the argument is not
<code>null</code> and is a <code>Boolean </code>object that
represents the same <code>boolean</code> value as this object.
只有当该参数是个不为null的Boolean对象,和自身对象表示的boolean值相等时,返回true。
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - the object to compare with.用来比较的对象。
<DT><B>Returns:</B><DD><code>true</code> if the Boolean objects represent the
same value; <code>false</code> otherwise.如果Boolean对象表示相同的值时为true,否则为false。<DT><B>See Also:</B><DD><A HREF="../../java/lang/Object.html#hashCode()"><CODE>Object.hashCode()</CODE></A>,
<A HREF="../../java/util/Hashtable.html" title="class in java.util"><CODE>Hashtable</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getBoolean(java.lang.String)"><!-- --></A><H3>
getBoolean</H3>
<PRE>
public static boolean <B>getBoolean</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> name)</PRE>
<DL>
<DD>Returns <code>true</code> if and only if the system property
named by the argument exists and is equal to the string
<code>"true"</code>. (Beginning with version 1.0.2 of the
Java<font size="-2"><sup>TM</sup></font> platform, the test of
this string is case insensitive.) A system property is accessible
through <code>getProperty</code>, a method defined by the
<code>System</code> class.
只有当以参数命名的系统属性存在且等于字符串true时,返回true。(版本Java平台1.0.2开始,字符串的测试是忽略大小写的。)
系统属性可以通过System类的getProperty方法访问。
<p>
If there is no property with the specified name, or if the specified
name is empty or null, then <code>false</code> is returned.
如果没有指定名称的属性,或者指定的名称为空或null,那么返回false。
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the system property name.系统属性名称。
<DT><B>Returns:</B><DD>the <code>boolean</code> value of the system property.系统属性的boolean值。<DT><B>See Also:</B><DD><A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A>,
<A HREF="../../java/lang/System.html#getProperty(java.lang.String, java.lang.String)"><CODE>System.getProperty(java.lang.String, java.lang.String)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_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>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Boolean.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</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>Std. Ed. v1.4.2</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../java/lang/Byte.html" title="class in java.lang"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Boolean.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>
</BODY>
</HTML>