numberformatexception.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 422 行 · 第 1/2 页

HTML
422
字号
<!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:52:55 CST 2005 --><META http-equiv="Content-Type" content="text/html; charset=gb2312"><TITLE>类 java.lang.NumberFormatException 的使用 (Java 2 Platform SE 5.0)</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="类 java.lang.NumberFormatException 的使用 (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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../NumberFormatException.html" title="java.lang 中的类"><FONT CLASS="NavBarFont1"><B>类</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>使用</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</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>Standard&nbsp;Ed. 5.0</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;上一个&nbsp;&nbsp;下一个</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html@java_2Flang_2F_2Fclass-useNumberFormatException.html" target="_top"><B>框架</B></A>  &nbsp;&nbsp;<A HREF="NumberFormatException.html" target="_top"><B>无框架</B></A>  &nbsp;&nbsp;<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></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><CENTER><H2><B>类 java.lang.NumberFormatException<br>的使用</B></H2></CENTER><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">使用 <A HREF="../NumberFormatException.html" title="java.lang 中的类">NumberFormatException</A> 的软件包</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><A HREF="#java.lang"><B>java.lang</B></A></TD><TD>提供利用 Java 编程语言进行程序设计的基础类。&nbsp;</TD></TR></TABLE>&nbsp;<P><A NAME="java.lang"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><A HREF="../package-summary.html">java.lang</A> 中 <A HREF="../NumberFormatException.html" title="java.lang 中的类">NumberFormatException</A> 的使用</FONT></TH></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">抛出 <A HREF="../NumberFormatException.html" title="java.lang 中的类">NumberFormatException</A> 的 <A HREF="../package-summary.html">java.lang</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../Byte.html" title="java.lang 中的类">Byte</A></CODE></FONT></TD><TD><CODE><B>Byte.</B><B><A HREF="../Byte.html#decode(java.lang.String)">decode</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;nm)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将 <code>String</code> 解码为 <code>Byte</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../Short.html" title="java.lang 中的类">Short</A></CODE></FONT></TD><TD><CODE><B>Short.</B><B><A HREF="../Short.html#decode(java.lang.String)">decode</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;nm)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将 <code>String</code> 解码为 <code>Short</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../Integer.html" title="java.lang 中的类">Integer</A></CODE></FONT></TD><TD><CODE><B>Integer.</B><B><A HREF="../Integer.html#decode(java.lang.String)">decode</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;nm)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将 <code>String</code> 解码为 <code>Integer</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../Long.html" title="java.lang 中的类">Long</A></CODE></FONT></TD><TD><CODE><B>Long.</B><B><A HREF="../Long.html#decode(java.lang.String)">decode</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;nm)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将 <code>String</code> 解码成 <code>Long</code>。</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>Package.</B><B><A HREF="../Package.html#isCompatibleWith(java.lang.String)">isCompatibleWith</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;desired)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;比较此包的规范版本和所需版本。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;byte</CODE></FONT></TD><TD><CODE><B>Byte.</B><B><A HREF="../Byte.html#parseByte(java.lang.String)">parseByte</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将 string 参数分析为有符号的十进制 <code>byte</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;byte</CODE></FONT></TD><TD><CODE><B>Byte.</B><B><A HREF="../Byte.html#parseByte(java.lang.String, int)">parseByte</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;s,          int&nbsp;radix)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将 string 参数分析为一个有符号的 <code>byte</code>,其基数由第二个参数指定。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;double</CODE></FONT></TD><TD><CODE><B>Double.</B><B><A HREF="../Double.html#parseDouble(java.lang.String)">parseDouble</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个新的 <code>double</code> 值,该值被初始化为用指定 <code>String</code> 表示的值,这与 <code>Double</code> 类的 <code>valueOf</code> 方法产生的值类似。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;float</CODE></FONT></TD><TD><CODE><B>Float.</B><B><A HREF="../Float.html#parseFloat(java.lang.String)">parseFloat</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个新的 <code>float</code> 值,该值被初始化为用指定 <code>String</code> 表示的值,这与 <code>Float</code> 类的 <code>valueOf</code> 方法产生的值类似。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B>Integer.</B><B><A HREF="../Integer.html#parseInt(java.lang.String)">parseInt</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将字符串参数作为有符号的十进制整数进行分析。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B>Integer.</B><B><A HREF="../Integer.html#parseInt(java.lang.String, int)">parseInt</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;s,         int&nbsp;radix)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用第二个参数指定的基数,将字符串参数解析为有符号的整数。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;long</CODE></FONT></TD><TD><CODE><B>Long.</B><B><A HREF="../Long.html#parseLong(java.lang.String)">parseLong</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将 string 参数分析为有符号十进制 <code>long</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;long</CODE></FONT></TD><TD><CODE><B>Long.</B><B><A HREF="../Long.html#parseLong(java.lang.String, int)">parseLong</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;s,

⌨️ 快捷键说明

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