short.html

来自「API資料大全」· HTML 代码 · 共 739 行 · 第 1/3 页

HTML
739
字号
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Assuming the specified String represents a short, returns that short's value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;short</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Short.html#shortValue()">shortValue</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the value of this Short as a short.</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">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Short.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a String object representing this Short's value.</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">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Short.html#toString(short)">toString</A></B>(short&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new String object representing the specified Short.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../java/lang/Short.html">Short</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Short.html#valueOf(java.lang.String)">valueOf</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Assuming the specified String represents a short, returns a new Short object initialized to that value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../java/lang/Short.html">Short</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Short.html#valueOf(java.lang.String, int)">valueOf</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;s,        int&nbsp;radix)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Assuming the specified String represents a short, returns a new Short object initialized to that value.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">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>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="MIN_VALUE"><!-- --></A><H3>MIN_VALUE</H3><PRE>public static final short <B>MIN_VALUE</B></PRE><DL><DD>The minimum value a Short can have.</DL><HR><A NAME="MAX_VALUE"><!-- --></A><H3>MAX_VALUE</H3><PRE>public static final short <B>MAX_VALUE</B></PRE><DL><DD>The maximum value a Short can have.</DL><HR><A NAME="TYPE"><!-- --></A><H3>TYPE</H3><PRE>public static final <A HREF="../../java/lang/Class.html">Class</A> <B>TYPE</B></PRE><DL><DD>The Class object representing the primitive type short.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Short(short)"><!-- --></A><H3>Short</H3><PRE>public <B>Short</B>(short&nbsp;value)</PRE><DL><DD>Constructs a Short object initialized to the specified short value.<DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the initial value of the Short</DL></DD></DL><HR><A NAME="Short(java.lang.String)"><!-- --></A><H3>Short</H3><PRE>public <B>Short</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;s)      throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Constructs a Short object initialized to the value specified by the String parameter.  The radix is assumed to be 10.<DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the String to be converted to a Short<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - If the String does not			contain a parsable short.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="toString(short)"><!-- --></A><H3>toString</H3><PRE>public static <A HREF="../../java/lang/String.html">String</A> <B>toString</B>(short&nbsp;s)</PRE><DL><DD>Returns a new String object representing the specified Short. The radix is assumed to be 10.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the short to be converted<DT><B>Returns:</B><DD>The String that represents the specified short in radix 10.</DL></DD></DL><HR><A NAME="parseShort(java.lang.String)"><!-- --></A><H3>parseShort</H3><PRE>public static short <B>parseShort</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;s)                        throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Assuming the specified String represents a short, returns that short's value. Throws an exception if the String cannot be parsed as a short.  The radix is assumed to be 10.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the String containing the short<DT><B>Returns:</B><DD>short    the value represented by the specified string<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - If the string does not			contain a parsable short.</DL></DD></DL><HR><A NAME="parseShort(java.lang.String, int)"><!-- --></A><H3>parseShort</H3><PRE>public static short <B>parseShort</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;s,                               int&nbsp;radix)                        throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Assuming the specified String represents a short, returns that short's value. Throws an exception if the String cannot be parsed as a short.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the String containing the short<DD><CODE>radix</CODE> - the radix to be used<DT><B>Returns:</B><DD>The short value represented by the specified string in                  the specified radix.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - If the String does not			contain a parsable short.</DL></DD></DL><HR><A NAME="valueOf(java.lang.String, int)"><!-- --></A><H3>valueOf</H3><PRE>public static <A HREF="../../java/lang/Short.html">Short</A> <B>valueOf</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;s,                            int&nbsp;radix)                     throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Assuming the specified String represents a short, returns a new Short object initialized to that value.  Throws an exception if the String cannot be parsed as a short.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the String containing the integer<DD><CODE>radix</CODE> - the radix to be used<DT><B>Returns:</B><DD>The Short value represented by the specified string in                  the specified radix.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - If the String does not			contain a parsable short.</DL></DD></DL><HR><A NAME="valueOf(java.lang.String)"><!-- --></A><H3>valueOf</H3><PRE>public static <A HREF="../../java/lang/Short.html">Short</A> <B>valueOf</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;s)                     throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Assuming the specified String represents a short, returns a new Short object initialized to that value.  Throws an exception if the String cannot be parsed as a short.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the String containing the integer<DT><B>Returns:</B><DD>Short    of the value represented by the specified string in                  radix 10.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - If the String does not			contain a parsable short.</DL></DD></DL><HR><A NAME="decode(java.lang.String)"><!-- --></A><H3>decode</H3><PRE>public static <A HREF="../../java/lang/Short.html">Short</A> <B>decode</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;nm)                    throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Decodes a <code>String</code> into a <code>Short</code>.  Accepts decimal, hexadecimal, and octal numbers, in the following formats: <pre>     [-]        decimal constant     [-] 0x     hex constant     [-] #      hex constant     [-] 0      octal constant </pre> The constant following an (optional) negative sign and/or "radix specifier" is parsed as by the <code>Short.parseShort</code> method with the specified radix (10, 8 or 16).  This constant must be positive

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?