分享
 
 
 

java.lang.Boolean翻译

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

<!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>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Boolean.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>

</TR>

</TABLE>

</TD>

<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>

<b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.4.2</b></EM>

</TD>

</TR>

<TR>

<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">

&nbsp;PREV CLASS&nbsp;

&nbsp;<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> &nbsp;

&nbsp;<A HREF="Boolean.html" target="_top"><B>NO FRAMES</B></A> &nbsp;

&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>

<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">

DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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&nbsp;<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>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;<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>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;<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>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;value)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;s)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;boolean</CODE></FONT></TD>

<TD><CODE><B><A HREF="../../java/lang/Boolean.html#booleanValue()">booleanValue</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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>&nbsp;obj)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;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>&nbsp;name)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;int</CODE></FONT></TD>

<TD><CODE><B><A HREF="../../java/lang/Boolean.html#hashCode()">hashCode</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;<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&nbsp;b)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;<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&nbsp;b)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;<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>&nbsp;s)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;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>&nbsp;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&nbsp;Boolean("True")</tt> produces a <tt>Boolean</tt> object

that represents <tt>true</tt>.生成表示true的Boolean对象。<br>

<tt>new&nbsp;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&nbsp;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>&nbsp;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&nbsp;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>&nbsp;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>&nbsp;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>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Boolean.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>

<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>

</TR>

</TABLE>

</TD>

<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>

<b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.4.2</b></EM>

</TD>

</TR>

<TR>

<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">

&nbsp;PREV CLASS&nbsp;

&nbsp;<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> &nbsp;

&nbsp;<A HREF="Boolean.html" target="_top"><B>NO FRAMES</B></A> &nbsp;

&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>

<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">

DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有